| java.lang.Object org.apache.ojb.odmg.TransactionImpl
All known Subclasses: org.apache.ojb.odmg.J2EETransactionImpl,
Method Summary | |
public void | abort() Abort and close the transaction. | public void | afterLoading(CollectionProxyDefaultImpl colProxy) Remove colProxy from list of pending collections and
register its contents with the transaction. | public void | afterMaterialization(IndirectionHandler handler, Object materializedObject) this callback is invoked after an Object is materialized
within an IndirectionHandler. | public void | beforeLoading(CollectionProxyDefaultImpl colProxy) | public void | beforeMaterialization(IndirectionHandler handler, Identity oid) this callback is invoked before an Object is materialized
within an IndirectionHandler. | public synchronized void | begin() Start a transaction. | protected boolean | cascadeDeleteFor(ObjectReferenceDescriptor ord) Returns true if cascading delete is enabled for the specified
single or collection descriptor. | protected void | checkForBegin() | protected void | checkForCommit() | public void | checkpoint() Commit the transaction, but reopen the transaction, retaining all locks.
Calling checkpoint commits persistent object modifications
made within the transaction since the last checkpoint to the database. | protected void | cleanupBroker() | public void | clearRegistrationList() Clears the list of processed object Identity. | public void | commit() Commit and close the transaction. | public void | configure(Configuration config) | public void | deletePersistent(RuntimeObject rt) | protected synchronized void | doAbort() Do the Aborts, but don't release the locks. | protected synchronized void | doClose() Close a transaction and do all the cleanup associated with it. | void | doSingleLock(ClassDescriptor cld, Object obj, Identity oid, int lockMode) Only lock the specified object, represented by
the
RuntimeObject instance.
Parameters: cld - The org.apache.ojb.broker.metadata.ClassDescriptorof the object to acquire a lock on. Parameters: oid - The org.apache.ojb.broker.Identity of the object to lock. Parameters: lockMode - lock mode to acquire. | void | doSingleRegister(RuntimeObject rtObject, int lockMode) Registers the object (without locking) with this transaction. | protected synchronized void | doWriteObjects(boolean isFlush) Write objects to data store, but don't release the locks. | public void | flush() | public DatabaseImpl | getAssociatedDatabase() | public PersistenceBroker | getBroker() | public PersistenceBrokerInternal | getBrokerInternal() Gets the broker associated with the transaction.
MBAIRD: only return the associated broker if the transaction is open,
if it's closed, throw a TransactionNotInProgressException. | public String | getGUID() | public ImplementationImpl | getImplementation() | int | getImpliciteLockType(int parentLockMode) | public NamedRootsMap | getNamedRootsMap() | public Object | getObjectByIdentity(Identity id) Get object by identity. | public ArrayList | getRegistrationList() Returns an empty List for registration of processed object Identity. | protected int | getStatus() | protected boolean | hasBroker() Returns true if an
org.apache.ojb.broker.PersistenceBroker was associated with this
tx instance. | public boolean | isDeleted(Identity id) | public boolean | isImplicitLocking() | public boolean | isOpen() Determine whether the transaction is open or not. | public boolean | isOrdering() Return true if the OJB ordering algorithm is enabled. | protected boolean | isTransient(ClassDescriptor cld, Object obj, Identity oid) Detect new objects. | public void | join() Attach the caller's thread to this Transaction and detach the
thread from any former Transaction the thread may have been
associated with. | public void | leave() Detach the caller's thread from this Transaction , but do not
attach the thread to another Transaction . | public void | lock(Object obj, int lockMode) Upgrade the lock on the given object to the given lock mode. | public void | lockAndRegister(RuntimeObject rtObject, int lockMode, List registeredObjects) Lock and register the specified object, make sure that when cascading locking and register
is enabled to specify a List to register the already processed object Identiy. | public synchronized void | lockAndRegister(RuntimeObject rtObject, int lockMode, boolean cascade, List registeredObjects) Lock and register the specified object, make sure that when cascading locking and register
is enabled to specify a List to register the already processed object Identiy. | void | makePersistent(RuntimeObject rt) | public void | markDelete(Object anObject) | public void | markDirty(Object anObject) | void | markDirty(RuntimeObject rt) | void | markPersistent(RuntimeObject rtObj) | protected void | performTransactionAwareAfterCommit() | protected void | performTransactionAwareAfterRollback() | protected void | performTransactionAwareBeforeCommit() | protected void | performTransactionAwareBeforeRollback() | protected void | prepareCommit() Prepare does the actual work of moving the changes at the object level
into storage (the underlying rdbms for instance). | protected void | refresh() | protected synchronized void | registerToIndirectionHandler(IndirectionHandler handler) | protected void | registerUnmaterializedLocks(Object obj) | public void | setCascadingDelete(Class target, String referenceField, boolean doCascade) Allows to change the cascading delete behavior of the specified reference
of the target class while this transaction is in use. | public void | setCascadingDelete(Class target, boolean doCascade) Allows to change the cascading delete behavior of all references of the
specified class while this transaction is in use - if the specified class is an
interface, abstract class or class with "extent" classes the cascading flag will
be propagated. | public synchronized void | setImplicitLocking(boolean value) | public void | setOrdering(boolean ordering) Allows to enable/disable the OJB persistent object ordering algorithm. | protected void | setStatus(int status) | public boolean | tryLock(Object obj, int lockMode) Upgrade the lock on the given object to the given lock mode. | protected synchronized void | unRegisterFromAllCollectionProxies() | protected synchronized void | unRegisterFromAllIndirectionHandlers() | protected synchronized void | unregisterFromCollectionProxy(CollectionProxy handler) | protected synchronized void | unregisterFromIndirectionHandler(IndirectionHandler handler) |
objectEnvelopeTable | protected ObjectEnvelopeTable objectEnvelopeTable(Code) | | the internal table containing all Objects "touched" by this tx and their
respective transactional state
|
TransactionImpl | public TransactionImpl(ImplementationImpl implementation)(Code) | | Creates new Transaction
Parameters: implementation - The odmg Implementation class |
abort | public void abort()(Code) | | Abort and close the transaction. Calling abort abandons all persistent
object modifications and releases the associated locks. Aborting a
transaction does not restore the state of modified transient objects
|
afterLoading | public void afterLoading(CollectionProxyDefaultImpl colProxy)(Code) | | Remove colProxy from list of pending collections and
register its contents with the transaction.
|
afterMaterialization | public void afterMaterialization(IndirectionHandler handler, Object materializedObject)(Code) | | this callback is invoked after an Object is materialized
within an IndirectionHandler.
this callback allows to defer registration of objects until
it's really neccessary.
Parameters: handler - the invoking handler Parameters: materializedObject - the materialized Object |
beforeMaterialization | public void beforeMaterialization(IndirectionHandler handler, Identity oid)(Code) | | this callback is invoked before an Object is materialized
within an IndirectionHandler.
Parameters: handler - the invoking handler Parameters: oid - the identity of the object to be materialized |
begin | public synchronized void begin()(Code) | | Start a transaction. Calling begin multiple times on the same
transaction object, without an intervening call to commit or
abort , causes the exception
TransactionInProgressException to be thrown on the second and
subsequent calls. Operations executed before a transaction has been opened,
or before reopening after a transaction is aborted or committed, have
undefined results; these may throw a
TransactionNotInProgressException exception.
|
cascadeDeleteFor | protected boolean cascadeDeleteFor(ObjectReferenceDescriptor ord)(Code) | | Returns true if cascading delete is enabled for the specified
single or collection descriptor.
|
checkForBegin | protected void checkForBegin()(Code) | | |
checkForCommit | protected void checkForCommit()(Code) | | |
checkpoint | public void checkpoint()(Code) | | Commit the transaction, but reopen the transaction, retaining all locks.
Calling checkpoint commits persistent object modifications
made within the transaction since the last checkpoint to the database. The
transaction retains all locks it held on those objects at the time the
checkpoint was invoked.
|
cleanupBroker | protected void cleanupBroker()(Code) | | |
clearRegistrationList | public void clearRegistrationList()(Code) | | Clears the list of processed object Identity.
|
commit | public void commit()(Code) | | Commit and close the transaction. Calling commit commits to
the database all persistent object modifications within the transaction and
releases any locks held by the transaction. A persistent object
modification is an update of any field of an existing persistent object, or
an update or creation of a new named object in the database. If a
persistent object modification results in a reference from an existing
persistent object to a transient object, the transient object is moved to
the database, and all references to it updated accordingly. Note that the
act of moving a transient object to the database may create still more
persistent references to transient objects, so its referents must be
examined and moved as well. This process continues until the database
contains no references to transient objects, a condition that is guaranteed
as part of transaction commit. Committing a transaction does not remove
from memory transient objects created during the transaction.
The updateObjectList contains a list of all objects for which this transaction
has write privledge to. We need to update these objects.
|
doAbort | protected synchronized void doAbort()(Code) | | Do the Aborts, but don't release the locks.
Do the aborts on the NamedRootsMap first, then
abort the other stuff.
|
doClose | protected synchronized void doClose()(Code) | | Close a transaction and do all the cleanup associated with it.
|
getAssociatedDatabase | public DatabaseImpl getAssociatedDatabase()(Code) | | Returns the associated database
|
getBrokerInternal | public PersistenceBrokerInternal getBrokerInternal()(Code) | | Gets the broker associated with the transaction.
MBAIRD: only return the associated broker if the transaction is open,
if it's closed, throw a TransactionNotInProgressException. If we allow
brokers to be reaquired by an already closed transaction, there is a
very good chance the broker will be leaked as the doClose() method of
transactionImpl will never be called and thus the broker will never
be closed and returned to the pool.
Returns a PersistenceBroker throws: TransactionNotInProgressException - is the transaction is not open; |
getImpliciteLockType | int getImpliciteLockType(int parentLockMode)(Code) | | |
getRegistrationList | public ArrayList getRegistrationList()(Code) | | Returns an empty List for registration of processed object Identity.
|
getStatus | protected int getStatus()(Code) | | |
isImplicitLocking | public boolean isImplicitLocking()(Code) | | |
isOpen | public boolean isOpen()(Code) | | Determine whether the transaction is open or not. A transaction is open if
a call has been made to begin , but a subsequent call to
either commit or abort has not been made.
True if the transaction is open, otherwise false. |
join | public void join()(Code) | | Attach the caller's thread to this Transaction and detach the
thread from any former Transaction the thread may have been
associated with.
|
leave | public void leave()(Code) | | Detach the caller's thread from this Transaction , but do not
attach the thread to another Transaction .
|
lock | public void lock(Object obj, int lockMode) throws LockNotGrantedException(Code) | | Upgrade the lock on the given object to the given lock mode. The call has
no effect if the object's current lock is already at or above that level of
lock mode.
Parameters: obj - object to acquire a lock on. Parameters: lockMode - lock mode to acquire. The lock modesare READ , UPGRADE , and WRITE . exception: LockNotGrantedException - Description of Exception |
lockAndRegister | public void lockAndRegister(RuntimeObject rtObject, int lockMode, List registeredObjects)(Code) | | Lock and register the specified object, make sure that when cascading locking and register
is enabled to specify a List to register the already processed object Identiy.
|
lockAndRegister | public synchronized void lockAndRegister(RuntimeObject rtObject, int lockMode, boolean cascade, List registeredObjects)(Code) | | Lock and register the specified object, make sure that when cascading locking and register
is enabled to specify a List to register the already processed object Identiy.
|
performTransactionAwareAfterCommit | protected void performTransactionAwareAfterCommit()(Code) | | |
performTransactionAwareAfterRollback | protected void performTransactionAwareAfterRollback()(Code) | | |
performTransactionAwareBeforeCommit | protected void performTransactionAwareBeforeCommit()(Code) | | |
performTransactionAwareBeforeRollback | protected void performTransactionAwareBeforeRollback()(Code) | | |
refresh | protected void refresh()(Code) | | cleanup tx and prepare for reuse
|
registerUnmaterializedLocks | protected void registerUnmaterializedLocks(Object obj)(Code) | | register proxy objects that were locked but haven't been materialized yet
so they can be unlocked when closing the transaction
|
setCascadingDelete | public void setCascadingDelete(Class target, String referenceField, boolean doCascade)(Code) | | Allows to change the cascading delete behavior of the specified reference
of the target class while this transaction is in use.
Parameters: target - The class to change cascading delete behavior of the references. Parameters: referenceField - The field name of the 1:1, 1:n or 1:n reference. Parameters: doCascade - If true cascading delete is enabled, false disabled. |
setCascadingDelete | public void setCascadingDelete(Class target, boolean doCascade)(Code) | | Allows to change the cascading delete behavior of all references of the
specified class while this transaction is in use - if the specified class is an
interface, abstract class or class with "extent" classes the cascading flag will
be propagated.
Parameters: target - The class to change cascading delete behavior of all references. Parameters: doCascade - If true cascading delete is enabled, false disabled. |
setOrdering | public void setOrdering(boolean ordering)(Code) | | Allows to enable/disable the OJB persistent object ordering algorithm. If
true OJB try to order the modified/new/deleted objects in a correct order
(based on a algorithm) before the objects are written to the persistent storage.
If false the order of the objects rely on the order specified by
the user and on settings like
TransactionImpl.setImplicitLocking(boolean) .
Parameters: ordering - Set true to enable object ordering on commit. |
setStatus | protected void setStatus(int status)(Code) | | |
tryLock | public boolean tryLock(Object obj, int lockMode)(Code) | | Upgrade the lock on the given object to the given lock mode. Method
tryLock is the same as lock except it returns a boolean
indicating whether the lock was granted instead of generating an exception.
Parameters: obj - Description of Parameter Parameters: lockMode - Description of Parameter Description of the Returned Value, UPGRADE , and WRITE . true if the lock has been acquired, otherwise false. |
unRegisterFromAllCollectionProxies | protected synchronized void unRegisterFromAllCollectionProxies()(Code) | | |
unRegisterFromAllIndirectionHandlers | protected synchronized void unRegisterFromAllIndirectionHandlers()(Code) | | |
unregisterFromCollectionProxy | protected synchronized void unregisterFromCollectionProxy(CollectionProxy handler)(Code) | | |
unregisterFromIndirectionHandler | protected synchronized void unregisterFromIndirectionHandler(IndirectionHandler handler)(Code) | | |
|
|