Forums Register Login

Getting an error

+Pie Number of slices to send: Send
hi there,

I'm getting this error in hibernate

Caused by: org.hibernate.NonUniqueObjectException: a different object with the same identifier value was already associated with the session: [com.my.nma.pojo .Lob#com.my.nma.pojo.LobId@bf82a59]

This message is a little bit cryptic. We found what the issue was. We had duplicate records for the same data and that was causing it. Is there some way to tell hibernate to spit out more information like some of the attibutes which are the key so that we can exactly tell what is it. Right now we had to take lot of hops to actually find what the issue was and connect the dot with the error.

Thanks

- Harjit
+Pie Number of slices to send: Send
Unfortunately, Hibernate is not going to know the state of your database, whether you have bad duplicate data in there. It can only say hey, you are trying to attach a second object with the same Primary Key to an object I already have in the persistent state. (In first level cache)

Mark
+Pie Number of slices to send: Send
There is no data yet in the database its still in the Transient form about to be inserted in the the database. What I'm talking about is lets say you have a array of objects which has keys on a member and suppose you have 2 records having the same ID is there any way in hibernate to spit which records are duplicate...

Thanks

- Harjit
Quick! Before anybody notices! Cover it up with this tiny ad:
a bit of art, as a gift, that will fit in a stocking
https://gardener-gift.com


reply
reply
This thread has been viewed 642 times.
Similar Threads
websphere hibernate class loader issue
Initial SessionFactory creation exception with RAD
Why it is happening like this...
Hibernate with annotation
db2 on OS390 clob problem
More...

All times above are in ranch (not your local) time.
The current ranch time is
Apr 16, 2024 07:26:10.