From: Gavin_King/Cirrus%<CI...@ci...> - 2002-08-14 23:33:34
|
Whoooaahh: >>> session.update(entry); This line is a bit confusing.... Why do you call Session.update() here? entry is already associated with the Session. Hibernate will detect changes to entry and update it's persistent state accordingly. The semantics of Session.update() are: "update the persistent state associated with the id with the state of the given *transient* instance". On the other hand, if everything else is right, the call to Session.update () for a persistent object *should* do precisely nothing..... (I can judge if this is the case from seeing the log.) My suspicion is that everything else is *not* right since that would explain why the collection is being removed (the first thing we would need to do after a call to Session.update() is remove any existing collections associated with that id). Anyhow, that line is extraneous and you don't need it. Remove it and see what happens. (But if the problem goes away we still need to understand exactly why it occurred.) Please, if you can send me actual code to step through, I would be able to resolve this very quickly. Otherwise even just the log output would be very helpful. I'm kinda stuck here if I can't reproduce this. Its just so difficult given that we are in different timezones.... Gavin P.S. I just (now) added some extra error detection in Session.update() so try grabbing a CVS update + see if it throws a different exception this time. |