org.apache.ojb.odmg
Interface TransactionExt

All Superinterfaces:
HasBroker, Transaction
All Known Implementing Classes:
NarrowTransaction, TransactionImpl

public interface TransactionExt
extends Transaction, HasBroker

Offers useful none odmg-standard methods of the odmg Transaction interface.

Note: All listed methods are not part of the standard ODMG-api - they are special (proprietary) OJB extensions.

Version:
$Id: TransactionExt.java,v 1.4.2.3 2005/03/23 16:56:29 arminw Exp $

Field Summary
 
Fields inherited from interface org.odmg.Transaction
READ, UPGRADE, WRITE
 
Method Summary
 void flush()
           Calling flush flushes persistent object modifications made within the ODMG transaction since the last checkpoint to the underlying database transaction, but does commit the database transaction.
 boolean isImplicitLocking()
          Returns true if implicite locking is enabled.
 void markDelete(java.lang.Object anObject)
          Marks an object for deletion without locking the object.
 void markDirty(java.lang.Object anObject)
          Marks an object as dirty without locking the object.
 void setCascadingDelete(java.lang.Class target, boolean doCascade)
          Allows to change the cascading delete behavior of all references of the specified class while this transaction is in use.
 void setCascadingDelete(java.lang.Class target, java.lang.String referenceField, boolean doCascade)
          Allows to change the cascading delete behavior of the target class's reference field while this transaction is in use.
 void setImplicitLocking(boolean value)
          This method can be used to activate or deactivate the implicit locking mechanism for the current transaction.
 
Methods inherited from interface org.odmg.Transaction
abort, begin, checkpoint, commit, isOpen, join, leave, lock, tryLock
 
Methods inherited from interface org.apache.ojb.odmg.HasBroker
getBroker
 

Method Detail

markDelete

public void markDelete(java.lang.Object anObject)
Marks an object for deletion without locking the object. If the object wasn't locked before, OJB will ask for a WRITE lock at commit.

Parameters:
anObject - Object to be marked

markDirty

public void markDirty(java.lang.Object anObject)
Marks an object as dirty without locking the object. If the object wasn't locked before, OJB will ask for a WRITE lock at commit.

Parameters:
anObject - Object to be marked

flush

public void flush()

Calling flush flushes persistent object modifications made within the ODMG transaction since the last checkpoint to the underlying database transaction, but does commit the database transaction. The ODMG transaction retains all locks it held on those objects at the time the flush was invoked.

This method is very similair to Transaction.checkpoint().


setImplicitLocking

public void setImplicitLocking(boolean value)
This method can be used to activate or deactivate the implicit locking mechanism for the current transaction. Turning of implicit locking may improve performance but requires additional care to make sure all changed objects are properly registered to the transaction.

Parameters:
value - If set true implicit locking is enabled, if false, implicit locking is disabled.

isImplicitLocking

public boolean isImplicitLocking()
Returns true if implicite locking is enabled.


setCascadingDelete

public void setCascadingDelete(java.lang.Class target,
                               java.lang.String referenceField,
                               boolean doCascade)
Allows to change the cascading delete behavior of the target class's reference field while this transaction is in use.

Parameters:
target - The class to change cascading delete behavior of the references.
referenceField - The field name of the 1:1, 1:n or 1:n reference.
doCascade - If true cascading delete is enabled, false disabled.

setCascadingDelete

public void setCascadingDelete(java.lang.Class target,
                               boolean doCascade)
Allows to change the cascading delete behavior of all references of the specified class while this transaction is in use.

Parameters:
target - The class to change cascading delete behavior of all references.
doCascade - If true cascading delete is enabled, false disabled.


(C) 2002 - 2004 Apache Software Foundation
All rights reserved. Published under the Apache License 2.0.
http://db.apache.org/ojb
Version: 1.0.3, 2005-04-2