This week's book giveaway is in the OO, Patterns, UML and Refactoring forum.
We're giving away four copies of Refactoring for Software Design Smells: Managing Technical Debt and have Girish Suryanarayana, Ganesh Samarthyam & Tushar Sharma on-line!
See this thread for details.
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

JavaRanch » Java Forums » Databases » Object Relational Mapping
Bookmark "org.hibernate.NonUniqueObjectException" Watch "org.hibernate.NonUniqueObjectException" New topic


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

Joined: Mar 07, 2010
Posts: 1682

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

[How To Ask Questions][Read before you PM me]
I’ve looked at a lot of different solutions, and in my humble opinion Aspose is the way to go. Here’s the link:
subject: org.hibernate.NonUniqueObjectException
It's not a secret anymore!