From: Gavin_King/Cirrus%<CI...@ci...> - 2002-07-26 16:43:32
|
<P>>I'm building a 3-tier Java GUI. I'd like to be able to issue queries= using<BR>>Hibernate, disconnect the Session and send it over the wire, = get the queried<BR>>objects out of the cache (and have any of those obje= ct's related objects<BR>>automatically come from the the cache if they'r= e in it), make changes to the<BR>>objects on the client side, send the w= hole session back to the server,<BR>>reconnect the Session to the dataso= urce and flush to apply any updates that<BR>>happened on either side to = the database.<BR><BR>yeah, thats essentially doable at present. All you wou= ld need is to make a<BR>little patch to allow deserialization of the sessio= n in a process where<BR>its SessionFactory is missing. <BR><BR>The main pro= blem for your application would be how to get a reference to <BR>the object= s you need on the client side. If you returned the Session =5Fand=5F<BR>the= needed objects, it would work.<BR><BR>In a disconnected state, I *think* y= ou would be able to call any Session<BR>methods except find(), flush(), loc= k(), loadWithLock() (and load() for a <BR>missing object). Oh, and save() o= f an object using native key generation. <BR>I would need to test this to b= e sure though.<BR><BR>Currently the serialization/deserialization code is w= ritten assuming that<BR>it is used for failover of stateful session bean or= servlet session state<BR>to another server with a SessionFactory of the sa= me name. So you would<BR>need to remove that assumption.<BR><BR>Gavin</P>= |