Hello,
I use a type of session-per-request-with-detached-objects pattern in my layered application.
I have several situations where Collection's are retrieved from the database and these collections may contain duplicated information (same table row in different Java objects). I can't really help it, the application's domain object graph is not trivial and I can't lock() every transient object I ever retrieved every time I ask Hibernate to open a new Session and perform some operations.
So as there are duplicates in my Collection's, sometimes when I Session.saveOrUpdate() my objects, I get a NonUniqueObjectException.
So I would love Hibernate to simply ignore the duplicate objects and not throw exceptions. Is this possible, is this stupid, anybody met this situation and how did he/she solve it?
Thank you very much,
Adrian.
|