Prev Class | Next Class | Frames | No Frames |
Summary: Nested | Field | Method | Constr | Detail: Nested | Field | Method | Constr |
java.lang.Object
org.castor.persist.AbstractTransactionContext
public abstract class AbstractTransactionContext
extends java.lang.Object
implements TransactionContext
XAResourceImpl
.
Constructor Summary | |
|
Method Summary | |
void |
|
protected void | |
void |
|
protected abstract void |
|
void |
|
protected abstract void |
|
protected Iterator | |
void |
|
protected abstract Connection |
|
void |
|
void |
|
Object |
|
ClassLoader | |
Connection |
|
DbMetaInfo |
|
Database | |
int | |
String |
|
int | |
int | |
ObjectLock | |
boolean | |
boolean |
|
boolean |
|
boolean |
|
boolean |
|
boolean |
|
boolean |
|
boolean |
|
boolean |
|
boolean |
|
boolean |
|
boolean |
|
boolean |
|
Iterator | |
Object |
|
Object |
|
void |
|
void |
|
boolean |
|
boolean |
|
QueryResults |
|
void |
|
void |
|
protected abstract void |
|
void |
|
void |
|
void |
|
void |
|
void |
|
void |
|
void |
|
void |
|
void |
|
public AbstractTransactionContext(Database db)
Create a new transaction context. This method is used by the explicit transaction model.
- Parameters:
db
- Database instance
public final void addTxSynchronizable(TxSynchronizable synchronizable)
- Specified by:
- addTxSynchronizable in interface TransactionContext
protected final void clearConnections()
public final void close() throws TransactionAbortedException
- Specified by:
- close in interface TransactionContext
- See Also:
TransactionContext.close()
protected abstract void closeConnections() throws TransactionAbortedException
The derived class must implement this method and close all the connections used in this transaction.
- Throws:
TransactionAbortedException
- The transaction could not close all the connections.
public final void commit() throws TransactionAbortedException
- Specified by:
- commit in interface TransactionContext
- See Also:
TransactionContext.commit()
protected abstract void commitConnections() throws TransactionAbortedException
The derived class must implement this method and commit all the connections used in this transaction. If the transaction could not commit fully or partially, this method will throw anTransactionAbortedException
, causing a rollback to occur as the next step.
- Throws:
TransactionAbortedException
- The transaction could not commit fully or partially and should be rolled back.
protected final Iterator connectionsIterator()
public final void create(ClassMolder molder, Object object, OID depended) throws PersistenceException
- Specified by:
- create in interface TransactionContext
- See Also:
org.castor.persist.TransactionContext.create( org.exolab.castor.persist.ClassMolder, java.lang.Object, org.exolab.castor.persist.OID)
protected abstract Connection createConnection(LockEngine engine) throws PersistenceException
public final void delete(Object object) throws PersistenceException
- Specified by:
- delete in interface TransactionContext
- See Also:
org.castor.persist.TransactionContext.delete(java.lang.Object)
public final void expireCache(ClassMolder molder, Identity identity) throws PersistenceException
- Specified by:
- expireCache in interface TransactionContext
public final Object fetch(ClassMolder molder, Identity identity, AccessMode suggestedAccessMode) throws PersistenceException
- Specified by:
- fetch in interface TransactionContext
public final ClassLoader getClassLoader()
- Specified by:
- getClassLoader in interface TransactionContext
- See Also:
TransactionContext.getClassLoader()
public final Connection getConnection(LockEngine engine) throws PersistenceException
- Specified by:
- getConnection in interface TransactionContext
public final DbMetaInfo getConnectionInfo(LockEngine engine) throws PersistenceException
- Specified by:
- getConnectionInfo in interface TransactionContext
public final Database getDatabase()
- Specified by:
- getDatabase in interface TransactionContext
- See Also:
TransactionContext.getDatabase()
public final int getLockTimeout()
- Specified by:
- getLockTimeout in interface TransactionContext
- See Also:
TransactionContext.getLockTimeout()
public String getNamedQuery(ClassMolder molder, String name) throws QueryException
- Specified by:
- getNamedQuery in interface TransactionContext
- See Also:
org.castor.persist.TransactionContext.getNamedQuery( org.exolab.castor.persist.ClassMolder, java.lang.String)
public final int getStatus()
- Specified by:
- getStatus in interface TransactionContext
- See Also:
TransactionContext.getStatus()
public final int getTransactionTimeout()
- Specified by:
- getTransactionTimeout in interface TransactionContext
public final ObjectLock getWaitOnLock()
- Specified by:
- getWaitOnLock in interface TransactionContext
- See Also:
TransactionContext.getWaitOnLock()
public final boolean isAutoStore()
- Specified by:
- isAutoStore in interface TransactionContext
- See Also:
TransactionContext.isAutoStore()
public final boolean isCached(ClassMolder molder, Class cls, Identity identity) throws PersistenceException
- Specified by:
- isCached in interface TransactionContext
- See Also:
org.castor.persist.TransactionContext.isCached( org.exolab.castor.persist.ClassMolder, java.lang.Class, org.exolab.castor.persist.spi.Identity)
public final boolean isCreated(Object object)
- Specified by:
- isCreated in interface TransactionContext
- See Also:
org.castor.persist.TransactionContext.isCreated(java.lang.Object)
public final boolean isDeleted(Object object)
- Specified by:
- isDeleted in interface TransactionContext
- See Also:
org.castor.persist.TransactionContext.isDeleted(java.lang.Object)
public final boolean isDeletedByOID(OID oid)
- Specified by:
- isDeletedByOID in interface TransactionContext
public final boolean isDepended(OID master, Object dependent)
- Specified by:
- isDepended in interface TransactionContext
- See Also:
org.castor.persist.TransactionContext.isDepended( org.exolab.castor.persist.OID, java.lang.Object)
public final boolean isLocked(Class cls, Identity identity, LockEngine lockEngine)
Returns true if the object given is locked.
- Specified by:
- isLocked in interface TransactionContext
- Parameters:
cls
- Class instance of the object to be investigated.identity
- Identity of the object to be investigated.lockEngine
- Current LcokEngine instance
- Returns:
- True if the object in question is locked.
public final boolean isOpen()
- Specified by:
- isOpen in interface TransactionContext
- See Also:
TransactionContext.isOpen()
public final boolean isPersistent(Object object)
- Specified by:
- isPersistent in interface TransactionContext
- See Also:
org.castor.persist.TransactionContext.isPersistent(java.lang.Object)
public final boolean isReadOnly(Object object)
- Specified by:
- isReadOnly in interface TransactionContext
- See Also:
org.castor.persist.TransactionContext.isReadOnly(java.lang.Object)
public final boolean isRecorded(Object object)
- Specified by:
- isRecorded in interface TransactionContext
- See Also:
org.castor.persist.TransactionContext.isRecorded(java.lang.Object)
public final boolean isUpdateCacheNeeded(Object object)
- Specified by:
- isUpdateCacheNeeded in interface TransactionContext
- See Also:
org.castor.persist.TransactionContext.isUpdateCacheNeeded(java.lang.Object)
public final boolean isUpdatePersistNeeded(Object object)
- Specified by:
- isUpdatePersistNeeded in interface TransactionContext
- See Also:
org.castor.persist.TransactionContext.isUpdatePersistNeeded(java.lang.Object)
public final Iterator iterateReadWriteObjectsInTransaction()
- Specified by:
- iterateReadWriteObjectsInTransaction in interface TransactionContext
public final Object load(Identity identity, ProposedEntity proposedObject, AccessMode suggestedAccessMode) throws PersistenceException
- Specified by:
- load in interface TransactionContext
public final Object load(Identity identity, ProposedEntity proposedObject, AccessMode suggestedAccessMode, QueryResults results) throws PersistenceException
- Specified by:
- load in interface TransactionContext
public final void markCreate(ClassMolder molder, Object object, OID rootObjectOID) throws PersistenceException
- Specified by:
- markCreate in interface TransactionContext
- See Also:
org.castor.persist.TransactionContext.markCreate( org.exolab.castor.persist.ClassMolder, java.lang.Object, org.exolab.castor.persist.OID)
public final void markModified(Object object, boolean updatePersist, boolean updateCache)
- Specified by:
- markModified in interface TransactionContext
- See Also:
org.castor.persist.TransactionContext.markModified( java.lang.Object, boolean, boolean)
public final boolean markUpdate(ClassMolder molder, Object object, OID depended) throws PersistenceException
- Specified by:
- markUpdate in interface TransactionContext
- See Also:
org.castor.persist.TransactionContext.markUpdate( org.exolab.castor.persist.ClassMolder, java.lang.Object, org.exolab.castor.persist.OID)
public final boolean prepare() throws TransactionAbortedException
- Specified by:
- prepare in interface TransactionContext
- See Also:
TransactionContext.prepare()
public final QueryResults query(LockEngine engine, PersistenceQuery query, AccessMode accessMode, boolean scrollable) throws PersistenceException
- Specified by:
- query in interface TransactionContext
public final void removeTxSynchronizable(TxSynchronizable synchronizable)
- Specified by:
- removeTxSynchronizable in interface TransactionContext
public final void rollback()
- Specified by:
- rollback in interface TransactionContext
- See Also:
TransactionContext.rollback()
protected abstract void rollbackConnections()
The derived class must implement this method and rollback all the connections used in this transaction. The connections may be closed, as they will not be reused in this transaction. This operation is guaranteed to succeed.
public final void setAutoStore(boolean autoStore)
- Specified by:
- setAutoStore in interface TransactionContext
public final void setCallback(CallbackInterceptor callback)
- Specified by:
- setCallback in interface TransactionContext
public final void setInstanceFactory(InstanceFactory factory)
- Specified by:
- setInstanceFactory in interface TransactionContext
public final void setLockTimeout(int timeout)
- Specified by:
- setLockTimeout in interface TransactionContext
public final void setStatus(int status)
- Specified by:
- setStatus in interface TransactionContext
- See Also:
TransactionContext.setStatus(int)
public final void setTransactionTimeout(int timeout)
- Specified by:
- setTransactionTimeout in interface TransactionContext
public final void setWaitOnLock(ObjectLock lock)
- Specified by:
- setWaitOnLock in interface TransactionContext
public final void update(ClassMolder molder, Object object, OID depended) throws PersistenceException
- Specified by:
- update in interface TransactionContext
- See Also:
org.castor.persist.TransactionContext.update( org.exolab.castor.persist.ClassMolder, java.lang.Object, org.exolab.castor.persist.OID)
public final void writeLock(Object object, int timeout) throws PersistenceException
- Specified by:
- writeLock in interface TransactionContext
- See Also:
org.castor.persist.TransactionContext.writeLock(java.lang.Object, int)