-->
These old forums are deprecated now and set to read-only. We are waiting for you on our new forums!
More modern, Discourse-based and with GitHub/Google/Twitter authentication built-in.

All times are UTC - 5 hours [ DST ]



Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 2 posts ] 
Author Message
 Post subject: Auto update using uniqueResult?
PostPosted: Mon Sep 12, 2005 11:14 pm 
Newbie

Joined: Mon Jun 13, 2005 6:07 am
Posts: 2
Hi

i have been getting weird result when i use criteria.uniqueResult()

when i test the DAO using junit, it works fine by only returning the unique result or NonUniqueResultException. however, when i try to call the same method from my ServiceManager it keeps giving me ConstraintViolationException. i can see that it actually did an "UPDATE" instead of "SELECT" from the SQL statement.

And i have another similar method, which is working fine too. the only difference is that the one that is giving me problem is search using unique key. anything wrong that i'm not aware of?


WARN [http-8080-Processor24] JDBCExceptionReporter.logExceptions(71) | SQL Error: -803, SQLState: 23505
ERROR [http-8080-Processor24] JDBCExceptionReporter.logExceptions(72) | [IBM][CLI Driver][DB2/NT] SQL0803N One or more values in the INSERT statement, UPDATE statement, or foreign key update caused by a DELETE statement are not valid because the primary key, unique constraint or unique index identified by "2" constrains table "ADMIN.USERS" from having duplicate rows for those columns. SQLSTATE=23505

ERROR [http-8080-Processor24] AbstractFlushingEventListener.performExecutions(277) | Could not synchronize database state with session
org.hibernate.exception.ConstraintViolationException: could not update:


Top
 Profile  
 
 Post subject: Re: Auto update using uniqueResult?
PostPosted: Tue Jan 10, 2006 12:06 pm 
Beginner
Beginner

Joined: Tue Jul 05, 2005 4:44 am
Posts: 40
Location: Paris, France
skeng wrote:
i have been getting weird result when i use criteria.uniqueResult()
I think you have post your message in the wrong forum, but I have exactly the same error. Have you resolved the error ?
Thx for your help,

_________________
Fred


Top
 Profile  
 
Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 2 posts ] 

All times are UTC - 5 hours [ DST ]


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum

Search for:
© Copyright 2014, Red Hat Inc. All rights reserved. JBoss and Hibernate are registered trademarks and servicemarks of Red Hat, Inc.