Hi folks,

my application uses 'long-living' hibernate objects that are either stored in session or application scope or
being persisted using the data squeezer.

So far I digged two approaches for managing hibernate objects in tapestry:

#1: just serialize object [java.io.Serializable] and later on (after deserialization) attach it to the hibernate session using e.g. session.lock(obj, mode) #2: store the [primary key + type] instead of the real object and later get it back using session.get(type, id)

So far I discovered two problems with #1

example 1:
- user 1 stores object in session
- user 2 deletes it in the meantime
- user 1 tries to reattach from session -> BOOM!!

example 2:
- user 1 displays some master-detail relationshop
- user 2 add a new detail
- user 1 (after reattach) gets the old version without the new detail of user 2 (I am not quite sure if this behaviour is by design or by me from improper usage of hibernate)

#2 seems to be better fitting but this would require to interfere with all data squeezers and persistence managers (and ???) in tapestry to get a transparent solution without hibernate code distributed all over in your pages. Also it's less performant as for every request a few selects are required (even though this might happen inside the second level cache). And it's contrary to tapestry's philosopy of keeping objects instead of id's.

Can somebody give me a reality check on that or tell me if I am missing some elegant solution?

Thanks a lot
Pete

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to