| org.apache.ojb.odmg.TransactionExt
All known Subclasses: org.apache.ojb.odmg.TransactionImpl, org.apache.ojb.odmg.NarrowTransaction,
TransactionExt | public interface TransactionExt extends Transaction,HasBroker(Code) | | Offers useful none odmg-standard methods of the odmg
org.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.8 2005/12/21 22:29:21 tomdz Exp $ |
Method Summary | |
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. | public boolean | isDeleted(Identity id) Checks if the object with the given
org.apache.ojb.broker.Identity has been deleted within the transaction using
org.odmg.Database.deletePersistent(Object) or
TransactionExt.markDelete(Object) .
Parameters: id - The identity of the object. | public boolean | isImplicitLocking() Returns true if implicite locking is enabled. | public boolean | isOrdering() Return true if the OJB ordering algorithm is enabled. | public void | markDelete(Object anObject) Marks an object for deletion without
locking the object. | public void | markDirty(Object anObject) Marks an object as dirty without
locking the object. | public void | setCascadingDelete(Class target, String referenceField, boolean doCascade) Allows to change the cascading delete behavior of the target class's
reference field 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. | public void | setImplicitLocking(boolean value) This method can be used to activate or deactivate the implicit
locking mechanism for the current transaction.
If set true OJB implicitly locks objects to ODMG transactions
after performing OQL queries. | public void | setOrdering(boolean ordering) Allows to enable/disable the OJB persistent object ordering algorithm. |
flush | public void flush()(Code) | |
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
org.odmg.Transaction.checkpoint .
|
markDelete | public void markDelete(Object anObject)(Code) | | 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(Object anObject)(Code) | | 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 |
setCascadingDelete | public void setCascadingDelete(Class target, String referenceField, boolean doCascade)(Code) | | 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. Parameters: referenceField - The field name of the 1:1, 1:n or m: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.
Parameters: target - The class to change cascading delete behavior of all references. Parameters: doCascade - If true cascading delete is enabled, false disabled. |
setImplicitLocking | public void setImplicitLocking(boolean value)(Code) | | This method can be used to activate or deactivate the implicit
locking mechanism for the current transaction.
If set true OJB implicitly locks objects to ODMG transactions
after performing OQL queries. Also if implicit locking is used
locking objects is recursive, that is associated objects are also
locked. If ImplicitLocking is set to 'false', no locks are obtained
in OQL queries, lookup objects and there is also no recursive locking.
Turning off 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. See Also: ImplementationExt.setImplicitLocking(boolean) |
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 the used databases support 'deferred checks' it's recommended to
use this feature and to disable OJB's object ordering.
If false the order of the objects rely on the order specified by
the user and on settings like
TransactionExt.setImplicitLocking(boolean) .
Parameters: ordering - Set true to enable object ordering on commit. See Also: ImplementationExt.setOrdering(boolean) |
|
|