File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes Object Relational Mapping and the fly likes org.hibernate.NonUniqueObjectException Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Android Security Essentials Live Lessons this week in the Android forum!
JavaRanch » Java Forums » Databases » Object Relational Mapping
Bookmark "org.hibernate.NonUniqueObjectException" Watch "org.hibernate.NonUniqueObjectException" New topic
Author

org.hibernate.NonUniqueObjectException

Singh Harmeet
Ranch Hand

Joined: Aug 05, 2011
Posts: 115

i was try to generate the org.hibernate.NonUniqueObjectException exception , but there is not exception generated . there is follwing code


With Regards :-
Harmeet Singh
Bill Gorder
Bartender

Joined: Mar 07, 2010
Posts: 1648
    
    7

You cannot have 2 objects with the same persistent id in the context at the same time or you get this exception. In your example this does not happen.

Here is a blog that explains it a bit
http://kousikraj.wordpress.com/2010/12/31/hibernate-non-unique-object-exception/


[How To Ask Questions][Read before you PM me]
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: org.hibernate.NonUniqueObjectException
 
Similar Threads
Problem in Adding Attributes to TLD file
Doubt in an Object instance while using evict() method
Test duplication on db with exception...am I on the right track?
how to refactor this method ?
Hibernate Query