|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.apache.ojb.odmg.NarrowTransaction
public class NarrowTransaction
Wraps Transaction
in managed environments.
Field Summary | |
---|---|
private TransactionImpl |
tx
|
Fields inherited from interface org.odmg.Transaction |
---|
READ, UPGRADE, WRITE |
Constructor Summary | |
---|---|
NarrowTransaction(TransactionImpl tx)
|
Method Summary | |
---|---|
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. |
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(Object obj,
int lockMode)
lock the given object |
void |
markDelete(Object anObject)
Marks an object for deletion without locking the object. |
void |
markDirty(Object anObject)
Marks an object as dirty without locking the object. |
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. |
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. |
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(Object obj,
int lockMode)
lock the given object if possible |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
private TransactionImpl tx
Constructor Detail |
---|
public NarrowTransaction(TransactionImpl tx)
Method Detail |
---|
public TransactionImpl getRealTransaction()
public void markDelete(Object anObject)
TransactionExt
markDelete
in interface TransactionExt
anObject
- Object to be markedpublic void markDirty(Object anObject)
TransactionExt
markDirty
in interface TransactionExt
anObject
- 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 TransactionExt
public PersistenceBroker getBroker()
getBroker
in interface HasBroker
public void join()
join
in interface Transaction
public void leave()
leave
in interface Transaction
public void begin()
begin
in interface Transaction
public boolean isOpen()
isOpen
in interface Transaction
public void commit()
commit
in interface Transaction
public void abort()
abort
in interface Transaction
public void checkpoint()
checkpoint
in interface Transaction
public void lock(Object obj, int lockMode) throws LockNotGrantedException
lock
in interface Transaction
obj
- 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(Object obj, int lockMode)
tryLock
in interface Transaction
obj
- 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 Object getObjectByIdentity(Identity id) throws PersistenceBrokerException
PersistenceBrokerException
public void setImplicitLocking(boolean value)
TransactionExt
setImplicitLocking
in interface TransactionExt
value
- If set true implicit locking is enabled,
if false, implicit locking is disabled.TransactionExt.setImplicitLocking(boolean)
public boolean isImplicitLocking()
TransactionExt
isImplicitLocking
in interface TransactionExt
TransactionExt.isImplicitLocking()
public void setCascadingDelete(Class target, String referenceField, boolean doCascade)
TransactionExt
setCascadingDelete
in interface TransactionExt
target
- 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(Class target, boolean doCascade)
TransactionExt
setCascadingDelete
in interface TransactionExt
target
- 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()
TransactionExt
isOrdering
in interface TransactionExt
TransactionExt.setOrdering(boolean)
public void setOrdering(boolean ordering)
TransactionExt
TransactionExt.setImplicitLocking(boolean)
.
setOrdering
in interface TransactionExt
ordering
- Set true to enable object ordering on commit.ImplementationExt.setOrdering(boolean)
public boolean isDeleted(Identity id)
TransactionExt
Identity
has been deleted within the transaction using
Database.deletePersistent(Object)
or TransactionExt.markDelete(Object)
.
isDeleted
in interface TransactionExt
id
- The identity of the object.
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |