Hibernate Team |
|
Joined: Fri Oct 05, 2007 4:47 pm Posts: 2536 Location: Third rock from the Sun
|
agree with pb00067, you should make sure that objects are not managed when you share them; use .clear() on the Session or better close the session. The other thread receiving a reference can eventually re-attach it; best way is probabily using the second-level cache: enable the cache and reload the data from hibernate. An alternative is to use lock(LockMode.NONE) which will re-attach a persistent object to your session (assuming it was detached from others). Generally make sure you never have an entity managed by more than one session.
_________________ Sanne http://in.relation.to/
|
|