We have a 3-tier Java GUI application using Hibernate as the O/R mapping
layer.  We've run into the problem of dealing with updating collections from
other sessions.  It seems Hibernate will recreate the collection if the
collection was loaded with a different persisted (see
SessionImpl.prepareCollectionForUpdate()).  This is always the case in my
app since we send domain objects to the client and then send them back to
the server to be updated.

I'm thinking about doing the following to work around this until I can come
up with a better idea:

1) Add a "ignoreCollections" flag to Session with a default of false.  When
set to true, it will skip the prepareCollectionsForUpdate method.
2) Classes with collections that need to be updated will implement the
Lifecycle interface and manually cascade the changes.

Does this sound like a workable solution?

Regards,
John Urberg

Software is not limited by physics, like buildings are. It is limited by
imagination, by design, by organization. In short, it is limited by
properties of people, not by properties of the world. "We have met the
enemy, and he is us." - Ralph Johnson



-------------------------------------------------------
This SF.net email is sponsored by: SF.net Giveback Program.
SourceForge.net hosts over 70,000 Open Source Projects.
See the people who have HELPED US provide better services:
Click here: http://sourceforge.net/supporters.php
_______________________________________________
hibernate-devel mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/hibernate-devel

Reply via email to