public class NarrowTransaction extends java.lang.Object implements TransactionExt
Transaction in managed environments.READ, UPGRADE, WRITE| Constructor and Description |
|---|
NarrowTransaction(TransactionImpl tx) |
| Modifier and Type | Method and Description |
|---|---|
void |
abort()
Abort the underlying odmg-transaction
|
void |
begin()
Not supported!!
|
void |
checkpoint()
Not supported!!
|
void |
commit()
Not supported!!
|
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. |
PersistenceBroker |
getBroker()
Return associated PB instance, or null if not found.
|
java.lang.Object |
getObjectByIdentity(Identity id) |
TransactionImpl |
getRealTransaction() |
boolean |
isDeleted(Identity id)
Checks if the object with the given
Identity
has been deleted within the transaction using
Database.deletePersistent(Object) or TransactionExt.markDelete(Object). |
boolean |
isImplicitLocking()
Returns true if implicite locking is enabled.
|
boolean |
isOpen()
Not supported!!
|
boolean |
isOrdering()
Return true if the OJB ordering algorithm is enabled.
|
void |
join()
Not supported!!
|
void |
leave()
Not supported!!
|
void |
lock(java.lang.Object obj,
int lockMode)
lock the given object
|
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.
|
void |
setOrdering(boolean ordering)
Allows to enable/disable the OJB persistent object ordering algorithm.
|
boolean |
tryLock(java.lang.Object obj,
int lockMode)
lock the given object if possible
|
public NarrowTransaction(TransactionImpl tx)
public TransactionImpl getRealTransaction()
public void markDelete(java.lang.Object anObject)
TransactionExtmarkDelete in interface TransactionExtanObject - Object to be markedpublic void markDirty(java.lang.Object anObject)
TransactionExtmarkDirty in interface TransactionExtanObject - Object to be markedpublic void flush()
TransactionExt
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.
Transaction.checkpoint().flush in interface TransactionExtpublic PersistenceBroker getBroker()
public void join()
join in interface Transactionpublic void leave()
leave in interface Transactionpublic void begin()
begin in interface Transactionpublic boolean isOpen()
isOpen in interface Transactionpublic void commit()
commit in interface Transactionpublic void abort()
abort in interface Transactionpublic void checkpoint()
checkpoint in interface Transactionpublic void lock(java.lang.Object obj,
int lockMode)
throws LockNotGrantedException
lock in interface Transactionobj - The object to acquire a lock on.lockMode - The lock mode to acquire. The lock modes are READ,
UPGRADE, and WRITE.LockNotGrantedException - Is thrown if the given lock mode could not be acquired.Transaction.lock(java.lang.Object, int)public boolean tryLock(java.lang.Object obj,
int lockMode)
tryLock in interface Transactionobj - The object to acquire a lock on.lockMode - The lock mode to acquire. The lock modes are READ,
UPGRADE, and WRITE.Transaction.tryLock(java.lang.Object, int)public java.lang.Object getObjectByIdentity(Identity id) throws PersistenceBrokerException
PersistenceBrokerExceptionpublic void setImplicitLocking(boolean value)
TransactionExtsetImplicitLocking in interface TransactionExtvalue - If set true implicit locking is enabled,
if false, implicit locking is disabled.TransactionExt.setImplicitLocking(boolean)public boolean isImplicitLocking()
TransactionExtisImplicitLocking in interface TransactionExtTransactionExt.isImplicitLocking()public void setCascadingDelete(java.lang.Class target,
java.lang.String referenceField,
boolean doCascade)
TransactionExtsetCascadingDelete in interface TransactionExttarget - The class to change cascading delete behavior of the references.referenceField - The field name of the 1:1, 1:n or m:n reference.doCascade - If true cascading delete is enabled, false disabled.TransactionExt.setCascadingDelete(Class, String, boolean)public void setCascadingDelete(java.lang.Class target,
boolean doCascade)
TransactionExtsetCascadingDelete in interface TransactionExttarget - The class to change cascading delete behavior of all references.doCascade - If true cascading delete is enabled, false disabled.TransactionExt.setCascadingDelete(Class, boolean)public boolean isOrdering()
TransactionExtisOrdering in interface TransactionExtTransactionExt.setOrdering(boolean)public void setOrdering(boolean ordering)
TransactionExtTransactionExt.setImplicitLocking(boolean).setOrdering in interface TransactionExtordering - Set true to enable object ordering on commit.ImplementationExt.setOrdering(boolean)public boolean isDeleted(Identity id)
TransactionExtIdentity
has been deleted within the transaction using
Database.deletePersistent(Object) or TransactionExt.markDelete(Object).isDeleted in interface TransactionExtid - The identity of the object.(C) 2002 - 2005 Apache Software Foundation
All rights reserved. Published under the Apache License 2.0.
http://db.apache.org/ojb
Version: 1.0.4, 2005-12-30