com.orientechnologies.jdo
Class oTransaction

java.lang.Object
  extended bycom.orientechnologies.jdo.oTransaction
All Implemented Interfaces:
java.io.Serializable, Transaction

public class oTransaction
extends java.lang.Object
implements Transaction, java.io.Serializable

See Also:
Serialized Form

Constructor Summary
oTransaction(oPersistenceManager iManager)
           
 
Method Summary
 void addObject(oOID iOid, java.lang.Object iObj)
           
 void begin()
          Begin a transaction.
 void checkpoint()
           
protected  void close()
           
 void commit()
          Commit the current transaction.
protected  void execute()
           
protected  void finalize()
           
 int getId()
           
 boolean getNontransactionalRead()
          If true, allows persistent instances to be read without a transaction active.
 boolean getNontransactionalWrite()
          If true, allows persistent instances to be written without a transaction active.
 boolean getOptimistic()
          Optimistic transactions do not hold data store locks until commit time.
 PersistenceManager getPersistenceManager()
          The Transaction instance is always associated with exactly one PersistenceManager.
 boolean getRestoreValues()
          Return the current value of the restoreValues property.
 boolean getRetainValues()
          If true, at commit time instances retain their field values.
 Synchronization getSynchronization()
          The user-specified Synchronization instance for this Transaction instance.
 boolean isActive()
          Returns whether there is a transaction currently active.
 java.lang.Object requestObject(oOID iOid)
           
 void rollback()
          Roll back the current transaction.
 void setNontransactionalRead(boolean parm1)
          If true, allow persistent instances to be read without a transaction active.
 void setNontransactionalWrite(boolean parm1)
          If true, allow persistent instances to be written without a transaction active.
 void setOptimistic(boolean parm1)
          Optimistic transactions do not hold data store locks until commit time.
 void setRestoreValues(boolean iFlag)
          If true, at rollback, fields of newly persistent instances are restored to their values as of the beginning of the transaction, and the instances revert to transient.
 void setRetainValues(boolean parm1)
          If true, at commit instances retain their values and the instances transition to persistent-nontransactional.
 void setSynchronization(Synchronization iSynch)
          The user can specify a Synchronization instance to be notified on transaction completions.
 
Methods inherited from class java.lang.Object
clone, equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

oTransaction

public oTransaction(oPersistenceManager iManager)
Method Detail

finalize

protected void finalize()

begin

public void begin()
Description copied from interface: Transaction
Begin a transaction. The type of transaction is determined by the setting of the Optimistic flag.

Specified by:
begin in interface Transaction
See Also:
Transaction.setOptimistic(boolean), Transaction.getOptimistic()

checkpoint

public void checkpoint()

commit

public void commit()
Description copied from interface: Transaction
Commit the current transaction.

Specified by:
commit in interface Transaction

rollback

public void rollback()
Description copied from interface: Transaction
Roll back the current transaction.

Specified by:
rollback in interface Transaction

execute

protected void execute()

close

protected void close()

isActive

public boolean isActive()
Description copied from interface: Transaction
Returns whether there is a transaction currently active.

Specified by:
isActive in interface Transaction
Returns:
true if the transaction is active.

setNontransactionalRead

public void setNontransactionalRead(boolean parm1)
Description copied from interface: Transaction
If true, allow persistent instances to be read without a transaction active. If an implementation does not support this option, a JDOUnsupportedOptionException is thrown.

Specified by:
setNontransactionalRead in interface Transaction
Parameters:
parm1 - the value of the nontransactionalRead property

getNontransactionalRead

public boolean getNontransactionalRead()
Description copied from interface: Transaction
If true, allows persistent instances to be read without a transaction active.

Specified by:
getNontransactionalRead in interface Transaction
Returns:
the value of the nontransactionalRead property

setNontransactionalWrite

public void setNontransactionalWrite(boolean parm1)
Description copied from interface: Transaction
If true, allow persistent instances to be written without a transaction active. If an implementation does not support this option, a JDOUnsupportedOptionException is thrown.

Specified by:
setNontransactionalWrite in interface Transaction
Parameters:
parm1 - the value of the nontransactionalRead property

getNontransactionalWrite

public boolean getNontransactionalWrite()
Description copied from interface: Transaction
If true, allows persistent instances to be written without a transaction active.

Specified by:
getNontransactionalWrite in interface Transaction
Returns:
the value of the nontransactionalWrite property

setRetainValues

public void setRetainValues(boolean parm1)
Description copied from interface: Transaction
If true, at commit instances retain their values and the instances transition to persistent-nontransactional. If an implementation does not support this option, a JDOUnsupportedOptionException is thrown.

Specified by:
setRetainValues in interface Transaction
Parameters:
parm1 - the value of the retainValues property

getRetainValues

public boolean getRetainValues()
Description copied from interface: Transaction
If true, at commit time instances retain their field values.

Specified by:
getRetainValues in interface Transaction
Returns:
the value of the retainValues property

getRestoreValues

public boolean getRestoreValues()
Description copied from interface: Transaction
Return the current value of the restoreValues property.

Specified by:
getRestoreValues in interface Transaction
Returns:
the value of the restoreValues property

setRestoreValues

public void setRestoreValues(boolean iFlag)
Description copied from interface: Transaction
If true, at rollback, fields of newly persistent instances are restored to their values as of the beginning of the transaction, and the instances revert to transient. Additionally, fields of modified instances of primitive types and immutable reference types are restored to their values as of the beginning of the transaction.

If false, at rollback, the values of fields of newly persistent instances are unchanged and the instances revert to transient. Additionally, dirty instances transition to hollow. If an implementation does not support this option, a JDOUnsupportedOptionException is thrown.

Specified by:
setRestoreValues in interface Transaction
Parameters:
iFlag - the value of the restoreValues property

setOptimistic

public void setOptimistic(boolean parm1)
Description copied from interface: Transaction
Optimistic transactions do not hold data store locks until commit time. If an implementation does not support this option, a JDOUnsupportedOptionException is thrown.

Specified by:
setOptimistic in interface Transaction
Parameters:
parm1 - the value of the Optimistic flag.

getOptimistic

public boolean getOptimistic()
Description copied from interface: Transaction
Optimistic transactions do not hold data store locks until commit time.

Specified by:
getOptimistic in interface Transaction
Returns:
the value of the Optimistic property.

setSynchronization

public void setSynchronization(Synchronization iSynch)
Description copied from interface: Transaction
The user can specify a Synchronization instance to be notified on transaction completions. The beforeCompletion method is called prior to flushing instances to the data store.

The afterCompletion method is called after performing state transitions of persistent and transactional instances, following the data store commit or rollback operation.

Only one Synchronization instance can be registered with the Transaction. If the application requires more than one instance to receive synchronization callbacks, then the single application instance is responsible for managing them, and forwarding callbacks to them.

Specified by:
setSynchronization in interface Transaction
Parameters:
iSynch - the Synchronization instance to be notified; null for none

getSynchronization

public Synchronization getSynchronization()
Description copied from interface: Transaction
The user-specified Synchronization instance for this Transaction instance.

Specified by:
getSynchronization in interface Transaction
Returns:
the user-specified Synchronization instance.

getPersistenceManager

public PersistenceManager getPersistenceManager()
Description copied from interface: Transaction
The Transaction instance is always associated with exactly one PersistenceManager.

Specified by:
getPersistenceManager in interface Transaction
Returns:
the PersistenceManager for this Transaction instance

requestObject

public java.lang.Object requestObject(oOID iOid)

addObject

public void addObject(oOID iOid,
                      java.lang.Object iObj)

getId

public int getId()