org.castor.persist
Class TransactionContext

java.lang.Object
  extended by org.castor.persist.TransactionContext
Direct Known Subclasses:
TransactionContextImpl

public abstract class TransactionContext
extends java.lang.Object

A transaction context is required in order to perform operations against the database. The transaction context is mapped to an API transaction or an XA transaction. The only way to begin a new transaction is through the creation of a new transaction context. A transaction context is created from an implementation class directly or through XAResourceImpl.

Since:
0.9.9
Version:
$Revision: 1.7 $ $Date: 2005/11/10 15:59:51 $
Author:
Assaf Arkin , Ralf Joachim, Werner Guttmann, Gregory Block

Constructor Summary
TransactionContext(Database db)
          Create a new transaction context.
TransactionContext(Database db, javax.transaction.Transaction transaction)
           
 
Method Summary
 void addTxSynchronizable(TxSynchronizable synchronizable)
          Register a listener which wants to synchronize its state to the state of the transaction.
 void close()
          Closes all Connections.
protected abstract  void closeConnections()
          The derived class must implement this method and close all the connections used in this transaction.
 void commit()
          Commits all changes and closes the transaction releasing all locks on all objects.
protected abstract  void commitConnections()
          The derived class must implement this method and commit all the connections used in this transaction.
 void create(LockEngine engine, ClassMolder molder, java.lang.Object object, OID depended)
          Creates a new object in persistent storage.
 void delete(java.lang.Object object)
          Deletes the object from persistent storage.
 void expireCache(LockEngine engine, ClassMolder molder, java.lang.Object identity)
          Expire object from the cache.
 java.lang.Object fetch(LockEngine engine, ClassMolder molder, java.lang.Object identity, AccessMode suggestedAccessMode)
           
 java.lang.ClassLoader getClassLoader()
          Get the current application ClassLoader.
abstract  java.sql.Connection getConnection(LockEngine engine)
          The derived class must implement this method and return an open connection for the specified engine.
abstract  DbMetaInfo getConnectionInfo(LockEngine engine)
          Returns meta-data related to the RDBMS used.
 Database getDatabase()
           
 int getLockTimeout()
          Returns the timeout waiting to acquire a lock.
 int getObjectState(java.lang.Object object)
           
 PersistenceInfoGroup getScope()
           
 int getStatus()
          Returns the status of this transaction.
 int getTransactionTimeout()
          Returns the timeout of this transaction.
 ObjectLock getWaitOnLock()
          Returns the lock which this transaction attempts to acquire.
protected  javax.transaction.xa.Xid getXid()
           
 boolean isAutoStore()
          Test if autoStore options is enabled or not.
 boolean isCached(LockEngine engine, ClassMolder molder, java.lang.Class cls, java.lang.Object identity)
           
 boolean isCreated(java.lang.Object object)
          Returns true if the object is marked as created in this transaction.
 boolean isDeleted(java.lang.Object object)
          True if and only if the specified object is loaded or created in this transaction and is deleted.
 boolean isDeletedByOID(OID oid)
           
 boolean isDepended(OID master, java.lang.Object dependent)
           
 boolean isOpen()
          Returns true if the transaction is open.
 boolean isPersistent(java.lang.Object object)
          Returns true if the object is persistent in this transaction.
 boolean isReadOnly(java.lang.Object object)
          Check to see whether this transaction considers an object to have been marked read-only.
 boolean isRecorded(java.lang.Object object)
          Returns true if the object is previously queried/loaded/update/create in this transaction
 boolean isUpdateCacheNeeded(java.lang.Object object)
          Retrieves the state of the object in this transaction.
 boolean isUpdatePersistNeeded(java.lang.Object object)
          Retrieves the state of the object in this transaction.
 java.util.Iterator iterateReadWriteObjectsInTransaction()
          Expose an enumeration of the commited object entries to allow TxSynchronizable to iterate through the objects.
 java.lang.Object load(LockEngine engine, ClassMolder molder, java.lang.Object identity, ProposedObject proposedObject, AccessMode suggestedAccessMode)
          Load an object for use within the transaction.
 java.lang.Object load(LockEngine engine, ClassMolder molder, java.lang.Object identity, ProposedObject proposedObject, AccessMode suggestedAccessMode, QueryResults results)
          Load an object for use within the transaction.
 void markCreate(LockEngine engine, ClassMolder molder, java.lang.Object object, OID rootObjectOID)
          Walk a data object tree starting from the specified object, and mark all object to be created.
(package private)  void markDelete(LockEngine engine, java.lang.Class type, java.lang.Object identity)
          Marks an object for deletion.
 void markModified(java.lang.Object object, boolean updatePersist, boolean updateCache)
           
 boolean markUpdate(LockEngine engine, ClassMolder molder, java.lang.Object object, OID depended)
          Update a new object in persistent storage and returns the object's OID.
 boolean prepare()
          Prepares the transaction prior to committing it.
 QueryResults query(LockEngine engine, PersistenceQuery query, AccessMode accessMode)
           
 QueryResults query(LockEngine engine, PersistenceQuery query, AccessMode accessMode, boolean scrollable)
          Perform a query using the query mechanism and in the specified access mode.
 void release(java.lang.Object object)
          Releases the lock granted on the object.
 void removeTxSynchronizable(TxSynchronizable synchronizable)
           
 void rollback()
           
protected abstract  void rollbackConnections()
          The derived class must implement this method and rollback all the connections used in this transaction.
 void setAutoStore(boolean autoStore)
          Enable or disable autoStore.
 void setCallback(CallbackInterceptor callback)
          Overrides the default callback interceptor by a custom interceptor for this database source.
 void setInstanceFactory(InstanceFactory factory)
          Overrides the default instance factory by a custom one for this database source.
 void setLockTimeout(int timeout)
          Sets the timeout waiting to acquire a lock.
 void setStatusActive()
          Sets the status of the current transaction to STATUS_ATIVE
 void setTransactionTimeout(int timeout)
          Sets the timeout of this transaction.
 void setWaitOnLock(ObjectLock lock)
          Indicates which lock this transaction is waiting for.
 void softLock(java.lang.Object object, int timeout)
          Acquire a write lock on the object.
protected  void txcommitted()
          Inform all registered listeners that the transaction was committed.
protected  void txrolledback()
          Inform all registered listeners that the transaction was rolled back.
 void update(LockEngine engine, ClassMolder molder, java.lang.Object object, OID depended)
          Update a new object in persistent storage and returns the object's OID.
 void writeLock(java.lang.Object object, int timeout)
          Acquire a write lock on the object.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

TransactionContext

public TransactionContext(Database db)
Create a new transaction context. This method is used by the explicit transaction model.


TransactionContext

public TransactionContext(Database db,
                          javax.transaction.Transaction transaction)
                   throws javax.transaction.SystemException
Throws:
javax.transaction.SystemException
Method Detail

addTxSynchronizable

public void addTxSynchronizable(TxSynchronizable synchronizable)
Register a listener which wants to synchronize its state to the state of the transaction.


removeTxSynchronizable

public void removeTxSynchronizable(TxSynchronizable synchronizable)
See Also:
addTxSynchronizable(org.exolab.castor.persist.TxSynchronizable)

txcommitted

protected void txcommitted()
Inform all registered listeners that the transaction was committed.


txrolledback

protected void txrolledback()
Inform all registered listeners that the transaction was rolled back.


setAutoStore

public void setAutoStore(boolean autoStore)
Enable or disable autoStore. If enabled, all new objects, which is reachable from other object that is quried, loaded, created in the transaction, will be created when the transaction is committed.


isAutoStore

public boolean isAutoStore()
Test if autoStore options is enabled or not.


setCallback

public void setCallback(CallbackInterceptor callback)
Overrides the default callback interceptor by a custom interceptor for this database source.

The interceptor is a callback that notifies data objects on persistent state events.

If callback interceptor is not overrided, events will be sent to data object that implements the org.exolab.castor.jdo.Persistent interface.

Parameters:
callback - The callback interceptor, null if disabled

setInstanceFactory

public void setInstanceFactory(InstanceFactory factory)
Overrides the default instance factory by a custom one for this database source.

The factory is used to obatain a new instance of data object when it is needed during loading.

Parameters:
factory - The instanceFactory to be used, null if disable

getScope

public PersistenceInfoGroup getScope()

setTransactionTimeout

public void setTransactionTimeout(int timeout)
Sets the timeout of this transaction. The timeout is specified in seconds.


getTransactionTimeout

public int getTransactionTimeout()
Returns the timeout of this transaction. The timeout is specified in seconds.


getLockTimeout

public int getLockTimeout()
Returns the timeout waiting to acquire a lock. The timeout is specified in seconds.


setLockTimeout

public void setLockTimeout(int timeout)
Sets the timeout waiting to acquire a lock. The timeout is specified in seconds.


setStatusActive

public void setStatusActive()
Sets the status of the current transaction to STATUS_ATIVE


getConnection

public abstract java.sql.Connection getConnection(LockEngine engine)
                                           throws PersistenceException
The derived class must implement this method and return an open connection for the specified engine. The connection should be created only one for a given engine in the same transaction.

Parameters:
engine - The persistence engine
Returns:
An open connection
Throws:
PersistenceException - An error occured talking to the persistence engine

getConnectionInfo

public abstract DbMetaInfo getConnectionInfo(LockEngine engine)
                                      throws PersistenceException
Returns meta-data related to the RDBMS used.

Parameters:
engine - LockEngine instance used.
Returns:
A DbMetaInfo instance describing var. features of the underlying RDBMS.
Throws:
PersistenceException

commitConnections

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 an TransactionAbortedException, causing a rollback to occur as the next step.

Throws:
TransactionAbortedException - The transaction could not commit fully or partially and should be rolled back

closeConnections

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

rollbackConnections

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.


fetch

public java.lang.Object fetch(LockEngine engine,
                              ClassMolder molder,
                              java.lang.Object identity,
                              AccessMode suggestedAccessMode)
                       throws ObjectNotFoundException,
                              LockNotGrantedException,
                              PersistenceException
Throws:
ObjectNotFoundException
LockNotGrantedException
PersistenceException

load

public java.lang.Object load(LockEngine engine,
                             ClassMolder molder,
                             java.lang.Object identity,
                             ProposedObject proposedObject,
                             AccessMode suggestedAccessMode)
                      throws ObjectNotFoundException,
                             LockNotGrantedException,
                             PersistenceException
Load an object for use within the transaction. Multiple access to the same object within the transaction will return the same object instance (except for read-only access).

This method is similar to fetch(org.exolab.castor.persist.LockEngine, org.exolab.castor.persist.ClassMolder, java.lang.Object, org.exolab.castor.mapping.AccessMode)except that it will load the object only once within a transaction and always return the same instance.

If the object is loaded for read-only then no lock is acquired and updates to the object are not reflected at commit time. If the object is loaded for read-write then a read lock is acquired (unless timeout or deadlock detected) and the object is stored at commit time. The object is then considered persistent and may be deleted or upgraded to write lock. If the object is loaded for exclusive access then a write lock is acquired and the object is synchronized with the persistent copy.

Attempting to load the object twice in the same transaction, once with exclusive lock and once with read-write lock will result in an exception.

Parameters:
engine - The persistence engine
molder - The class persistence molder
identity - The object's identity
objectToBeLoaded - The object to fetch (single instance per transaction)
suggestedAccessMode - The access mode (see AccessMode) the values in persistent storage
Returns:
object being loaded
Throws:
LockNotGrantedException - Timeout or deadlock occured attempting to acquire lock on object
ObjectNotFoundException - The object was not found in persistent storage
PersistenceException - An error reported by the persistence engine

load

public java.lang.Object load(LockEngine engine,
                             ClassMolder molder,
                             java.lang.Object identity,
                             ProposedObject proposedObject,
                             AccessMode suggestedAccessMode,
                             QueryResults results)
                      throws ObjectNotFoundException,
                             LockNotGrantedException,
                             PersistenceException
Load an object for use within the transaction. Multiple access to the same object within the transaction will return the same object instance (except for read-only access).

This method work the same as #load(LockEngine,ClassMolder,Object,Object,AccessMode), except a QueryResults can be specified.

Parameters:
engine - The persistence engine
molder - The class persistence molder
identity - The object's identity
proposedObject - The object to fetch (single instance per transaction)
suggestedAccessMode - The access mode (see AccessMode) the values in persistent storage
results - The QueryResult that the data to be loaded from.
Returns:
object being loaded
Throws:
LockNotGrantedException - Timeout or deadlock occured attempting to acquire lock on object
ObjectNotFoundException - The object was not found in persistent storage
PersistenceException - An error reported by the persistence engine

query

public QueryResults query(LockEngine engine,
                          PersistenceQuery query,
                          AccessMode accessMode,
                          boolean scrollable)
                   throws QueryException,
                          PersistenceException
Perform a query using the query mechanism and in the specified access mode. The query is performed in this transaction, and the returned query results can only be used while this transaction is open. It is assumed that the query mechanism is compatible with the persistence engine.

Parameters:
engine - The persistence engine
query - A query against the persistence engine
accessMode - The access mode
Returns:
A query result iterator
Throws:
QueryException - An invalid query
PersistenceException - An error reported by the persistence engine

query

public QueryResults query(LockEngine engine,
                          PersistenceQuery query,
                          AccessMode accessMode)
                   throws QueryException,
                          PersistenceException
Throws:
QueryException
PersistenceException

markCreate

public void markCreate(LockEngine engine,
                       ClassMolder molder,
                       java.lang.Object object,
                       OID rootObjectOID)
                throws DuplicateIdentityException,
                       PersistenceException
Walk a data object tree starting from the specified object, and mark all object to be created.

Parameters:
engine - The persistence engine
object - The object to persist
Throws:
DuplicateIdentityException - An object with this identity already exists in persistent storage
PersistenceException - An error reported by the persistence engine
ClassNotPersistenceCapableException - The class is not persistent capable

create

public void create(LockEngine engine,
                   ClassMolder molder,
                   java.lang.Object object,
                   OID depended)
            throws DuplicateIdentityException,
                   PersistenceException
Creates a new object in persistent storage. The object will be persisted only if the transaction commits. If an identity is provided then duplicate identity check happens in this method, if no identity is provided then duplicate identity check occurs when the transaction completes and the object is not visible in this transaction.

Parameters:
engine - The persistence engine
molder - The molder of the creating class
object - The object to persist
depended - The master object's OID if exist
Throws:
DuplicateIdentityException - An object with this identity already exists in persistent storage
PersistenceException - An error reported by the persistence engine
ClassNotPersistenceCapableException - The class is not persistent capable

markUpdate

public boolean markUpdate(LockEngine engine,
                          ClassMolder molder,
                          java.lang.Object object,
                          OID depended)
                   throws DuplicateIdentityException,
                          ObjectModifiedException,
                          ClassNotPersistenceCapableException,
                          PersistenceException
Update a new object in persistent storage and returns the object's OID. The object will be persisted only if the transaction commits. If an identity is provided then duplicate identity check happens in this method, if no identity is provided then duplicate identity check occurs when the transaction completes and the object is not visible in this transaction.

Update will also mark object to be created if the TIMESTAMP equals to NO_TIMESTAMP.

Parameters:
engine - The persistence engine
molder - The object's molder
object - The object to persist
depended - The master objects of the specified object to be created if exisit
Returns:
true if the object is marked to be created
Throws:
DuplicateIdentityException - An object with this identity already exists in persistent storage
PersistenceException - An error reported by the persistence engine
ClassNotPersistenceCapableException - The class is not persistent capable
ObjectModifiedException - Dirty checking mechanism may immediately report that the object was modified in the database during the long transaction.

update

public void update(LockEngine engine,
                   ClassMolder molder,
                   java.lang.Object object,
                   OID depended)
            throws DuplicateIdentityException,
                   ObjectModifiedException,
                   ClassNotPersistenceCapableException,
                   PersistenceException
Update a new object in persistent storage and returns the object's OID. The object will be persisted only if the transaction commits. If an identity is provided then duplicate identity check happens in this method, if no identity is provided then duplicate identity check occurs when the transaction completes and the object is not visible in this transaction.

Update will also mark object to be created if the TIMESTAMP equals to NO_TIMESTAMP.

Parameters:
engine - The persistence engine
molder - The object's molder
object - The object to persist
depended - The master objects of the specified object to be created if exisit
Throws:
DuplicateIdentityException - An object with this identity already exists in persistent storage
PersistenceException - An error reported by the persistence engine
ClassNotPersistenceCapableException - The class is not persistent capable
ObjectModifiedException - Dirty checking mechanism may immediately report that the object was modified in the database during the long transaction.

delete

public void delete(java.lang.Object object)
            throws ObjectNotPersistentException,
                   LockNotGrantedException,
                   PersistenceException
Deletes the object from persistent storage. The deletion will take effect only if the transaction is committed, but the object is no longer viewable for the current transaction and locks for access from other transactions will block until this transaction completes. A write lock is acquired in order to assure the object can be deleted.

Parameters:
object - The object to delete from persistent storage
Throws:
ObjectNotPersistentException - The object has not been queried or created in this transaction
LockNotGrantedException - Timeout or deadlock occured attempting to acquire lock on object
PersistenceException - An error reported by the persistence engine

writeLock

public void writeLock(java.lang.Object object,
                      int timeout)
               throws ObjectNotPersistentException,
                      LockNotGrantedException,
                      PersistenceException
Acquire a write lock on the object. Read locks are implicitly available when the object is queried. A write lock is only granted for objects that are created or deleted or for objects loaded in exclusive mode - this method can obtain such a lock explicitly. If the object already has a write lock in this transaction or a read lock in this transaction but no read lock in any other transaction, a write lock is obtained. If this object has a read lock in any other transaction this method will block until the other transaction will release its lock. If the specified timeout has elapsed or a deadlock has been detected, an exception will be thrown but the current lock will be retained.

Parameters:
object - The object to lock
timeout - Timeout waiting to acquire lock, specified in seconds, zero for no waiting, negative to use the default timeout for this transaction
Throws:
ObjectNotPersistentException - The object has not been queried or created in this transaction
LockNotGrantedException - Timeout or deadlock occured attempting to acquire lock on object
PersistenceException - An error reported by the persistence engine

markModified

public void markModified(java.lang.Object object,
                         boolean updatePersist,
                         boolean updateCache)

softLock

public void softLock(java.lang.Object object,
                     int timeout)
              throws LockNotGrantedException,
                     ObjectNotPersistentException
Acquire a write lock on the object. Read locks are implicitly available when the object is queried. A write lock is only granted for objects that are created or deleted or for objects loaded in exclusive mode - this method can obtain such a lock explicitly. If the object already has a write lock in this transaction or a read lock in this transaction but no read lock in any other transaction, a write lock is obtained. If this object has a read lock in any other transaction this method will block until the other transaction will release its lock. If the specified timeout has elapsed or a deadlock has been detected, an exception will be thrown but the current lock will be retained.

Parameters:
object - The object to lock
timeout - Timeout waiting to acquire lock, specified in seconds, zero for no waiting, negative to use the default timeout for this transaction
Throws:
ObjectNotPersistentException - The object has not been queried or created in this transaction
LockNotGrantedException - Timeout or deadlock occured attempting to acquire lock on object

release

public void release(java.lang.Object object)
             throws ObjectNotPersistentException,
                    PersistenceException
Releases the lock granted on the object. The object is removed from this transaction and will not participate in transaction commit/abort. Any changes done to the object are lost.

Parameters:
object - The object to release the lock
Throws:
ObjectNotPersistentException - The object was not queried or created in this transaction
PersistenceException - An error occured talking to the persistence engine

prepare

public boolean prepare()
                throws TransactionAbortedException
Prepares the transaction prior to committing it. Indicates whether the transaction is read-only (i.e. no modified objects), can commit, or an error has occured and the transaction must be rolled back. This method performs actual storage into the persistence storage. Multiple calls to this method can be done, and do not release locks, allowing checkpoint to occur.

Returns:
True if the transaction can commit, false if the transaction is read only
Throws:
java.lang.IllegalStateException - Method called if transaction is not in the proper state to perform this operation
TransactionAbortedException - The transaction has been aborted due to inconsistency, duplicate object identity, error with the persistence engine or any other reason

commit

public void commit()
            throws TransactionAbortedException
Commits all changes and closes the transaction releasing all locks on all objects. All objects are now transient. Must be called after a call to prepare()has returned successfully.

Throws:
TransactionAbortedException - The transaction has been aborted due to inconsistency, duplicate object identity, error with the persistence engine or any other reason
java.lang.IllegalStateException - This method has been called without calling prepare() first

iterateReadWriteObjectsInTransaction

public java.util.Iterator iterateReadWriteObjectsInTransaction()
Expose an enumeration of the commited object entries to allow TxSynchronizable to iterate through the objects.

Returns:
Iterator of modifiable (read-write) object entries.

rollback

public void rollback()

close

public void close()
           throws TransactionAbortedException
Closes all Connections. Must be called before the end of the transaction in EJB environment or after commit in standalone case.

Throws:
TransactionAbortedException - The transaction has been aborted due to inconsistency, duplicate object identity, error with the persistence engine or any other reason
java.lang.IllegalStateException - This method has been called after the end of the transaction.

isCreated

public boolean isCreated(java.lang.Object object)
Returns true if the object is marked as created in this transaction. Note that this does not find objects in the 'transitional' state of creating. Primarily intended to be used by tests.

Parameters:
object - The object to test the state of in this transaction.
Returns:
true if the object is marked as created within this transaction.

isUpdateCacheNeeded

public boolean isUpdateCacheNeeded(java.lang.Object object)
Retrieves the state of the object in this transaction. Specifically, in this case, that the object requires a cache update.

Parameters:
object - The object to test the state of in this transaction.
Returns:
true if the object is recorded in this transaction with the requested state.

isUpdatePersistNeeded

public boolean isUpdatePersistNeeded(java.lang.Object object)
Retrieves the state of the object in this transaction. Specifically, in this case, that the object requires a persistence update.

Parameters:
object - The object to test the state of in this transaction.
Returns:
true if the object is recorded in this transaction with the requested state.

isPersistent

public boolean isPersistent(java.lang.Object object)
Returns true if the object is persistent in this transaction.

Parameters:
object - The object
Returns:
True if persistent in transaction

isRecorded

public boolean isRecorded(java.lang.Object object)
Returns true if the object is previously queried/loaded/update/create in this transaction

Parameters:
object - The object
Returns:
True if recorded in this transaction

isDepended

public boolean isDepended(OID master,
                          java.lang.Object dependent)

getStatus

public int getStatus()
Returns the status of this transaction.


isOpen

public boolean isOpen()
Returns true if the transaction is open.


getXid

protected javax.transaction.xa.Xid getXid()

setWaitOnLock

public void setWaitOnLock(ObjectLock lock)
Indicates which lock this transaction is waiting for. When a transaction attempts to acquire a lock it must indicate which lock it attempts to acquire in order to perform dead-lock detection. This method is called by ObjectLockbefore entering the temporary lock-acquire state.

Parameters:
lock - The lock which this transaction attempts to acquire

getWaitOnLock

public ObjectLock getWaitOnLock()
Returns the lock which this transaction attempts to acquire.

Returns:
The lock which this transaction attempts to acquire

isDeleted

public boolean isDeleted(java.lang.Object object)
True if and only if the specified object is loaded or created in this transaction and is deleted.


isDeletedByOID

public boolean isDeletedByOID(OID oid)

getObjectState

public int getObjectState(java.lang.Object object)

getClassLoader

public java.lang.ClassLoader getClassLoader()
Get the current application ClassLoader.

Returns:
the current ClassLoader's instance. null if none has been provided

markDelete

void markDelete(LockEngine engine,
                java.lang.Class type,
                java.lang.Object identity)
          throws LockNotGrantedException,
                 PersistenceException
Marks an object for deletion. Used during the preparation stage to delete an attached relation by marking the object for deletion (if not already deleted) and preparing it a second time.

Throws:
LockNotGrantedException
PersistenceException

expireCache

public void expireCache(LockEngine engine,
                        ClassMolder molder,
                        java.lang.Object identity)
                 throws PersistenceException,
                        LockNotGrantedException
Expire object from the cache. Objects expired from the cache will be read from persistent storage, as opposed to being read from the cache, during subsequent load/query operations.

Parameters:
engine - The persistence engine
molder - The class persistence molder
identity - The object's identity
Throws:
PersistenceException
LockNotGrantedException

isCached

public boolean isCached(LockEngine engine,
                        ClassMolder molder,
                        java.lang.Class cls,
                        java.lang.Object identity)
                 throws PersistenceException
Throws:
PersistenceException

isReadOnly

public boolean isReadOnly(java.lang.Object object)
Check to see whether this transaction considers an object to have been marked read-only.

Parameters:
object - The object to test for read-only status
Returns:
True if the object is marked read-only in this transaction; otherwise, false.

getDatabase

public Database getDatabase()


Intalio Inc. (C) 1999-2004. All rights reserved http://www.intalio.com