Menu

#23 StaticDomains - problem saving/deleting

open
nobody
None
5
2002-04-08
2002-04-08
No

Problem:
After saving or deleting an object from
AbstractStaticDomain subclass, the subsequent finds do
not reflect the changes.

Quick solution for save:

remove final from the method

public PersistentObject save(PersistentObject aPO)

in AbstractDomain and in AbstractStaticDomain add the
following method

public final PersistentObject save(PersistentObject
aPO)
throws
ObjectHasChangedException,
MissingAttributeException,
DuplicateRowException
{
Map classMap = (Map) s_cache.get();
classMap.remove(this.getClass()); // empties the
cache

return this.save(aPO, this.getJDBCHelper());
} // save(aPersistentObject)

The same can be applied to delete method.

Richard Korinek

P.S. I am fairly new to Java and I did not dare to
post it as a patch ... could someone please check
it ...

Discussion


Log in to post a comment.