Hi Danilo, On Wed, 29 Oct 2003 08:56:01 +0100, Danilo Tommasina <[EMAIL PROTECTED]> wrote:
>Hello Jair, > >Automatically clearing the cache for the object touched by the aborted >transaction may cause loss of data, let's say it so, if storing data to >db fails due to a temporary db failure, then you will loose all the data >you last entered (if you don't have them backed up in other value >objects). So I would say that always and uncoditionally clearing the >cache is not a good idea. However it would be very useful if the >PersistenceBroker would have a method that allows to get the list of all >affected persistent objects and let the user decide if they have to be >removed from cache (ev. directly with another method call). Just to clarify: Removing an object from the cache does not delete the object in any way. It just removes a reference from a hash table so that looking up this object from the db again will get you a fresh, up-to-date instance. As long as you keep a reference to the modified object, you won't lose any data after clearing the cache. Cheers, Gerhard > >We also have the same problem, however because of the type of our object >model (lot of interconnected hierarchic revisionable data) we work with >auto-refresh and auto-update set to false, so we have to update all >relationships by hand. This way we always know wich objects are >affected, before every call to pb.store( obj ), we just put obj in a >'rollback'-list, if the transaction is aborted we remove from cache all >object available in our 'rollback'-list. > >If somebody has a better solution, just tell me... > >bye >danilo > --------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
