goodsjpi
Class OptimisticMetaobject
java.lang.Object
goodsjpi.Metaobject
goodsjpi.BasicMetaobject
goodsjpi.OptimisticMetaobject
- All Implemented Interfaces:
- java.io.Serializable
- public class OptimisticMetaobject
- extends BasicMetaobject
Metaobject for optimistic scheme of synchronization. Optimistic means we don't
lock. Multiple Readers, multiple Writers would be another way of putting it.
Another way to say this is of course, "You'd better know what you're doing", and
then later, "You've been warned".
On the other hand, if you do know that this is no problem, the benefit is that
you save the time for the locking (which is a network request in the Pessimistic
case)
- See Also:
- Serialized Form
Methods inherited from class goodsjpi.BasicMetaobject |
abortNestedTransaction, abortTransaction, abortTransaction, beginNestedTransaction, commitObjectChanges, commitTransaction, destroyObject, endNestedTransaction, forgetObject, invalidateObject, loadObject, makePersistent, notifyOnModification, postDaemon, preDaemon, preloadObject, releaseObject, sendForgottenObjectsToServers, undoObjectChanges |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
OptimisticMetaobject
public OptimisticMetaobject()
beginWriteAccess
public void beginWriteAccess(Persistent obj)
beginWriteAccess
is a no-op. That's why it's optimistic.
- Specified by:
beginWriteAccess
in class Metaobject
- Parameters:
obj
- a Persistent
object to be modified.
endAccess
public void endAccess(Persistent obj)
endAccess
adds the object to the cache managers transaction
list if the object has been modified.
- Specified by:
endAccess
in class Metaobject
- Parameters:
obj
- a Persistent
object that was (or was not) modified.
beginReadAccess
public void beginReadAccess(Persistent obj)
beginReadAccess
is a no-op. We're being optimistic, remember.
- Specified by:
beginReadAccess
in class Metaobject
- Parameters:
obj
- a Persistent
object to be modified.