public class TransactionImpl extends Object implements Transaction
Transaction| Modifier and Type | Field and Description |
|---|---|
protected static Localiser |
LOCALISER
Localisation of messages.
|
protected boolean |
rollbackOnly
Whether the transaction is only for roll-back.
|
protected Boolean |
serializeRead
Whether to serialise (lock) any read objects in this transaction.
|
TRANSACTION_ISOLATION_OPTION| Constructor and Description |
|---|
TransactionImpl(ExecutionContext ec)
Constructor for a transaction for the specified ExecutionContext.
|
| Modifier and Type | Method and Description |
|---|---|
void |
addTransactionEventListener(TransactionEventListener listener)
Adds a transaction listener.
|
void |
begin()
Method to begin the transaction.
|
void |
bindTransactionEventListener(TransactionEventListener listener)
Listeners that are never cleared, and invoked for all transactions
|
void |
close()
Method to inform the transaction that it is closed.
|
void |
commit()
Method to commit the transaction.
|
void |
end()
Method to allow the transaction to flush any resources.
|
void |
flush()
Method to flush the transaction.
|
boolean |
getIsActive()
Similar to "isActive" except that it just returns the "active" flag whereas the isActive() method can
also embody rejoining to underlying transactions.
|
boolean |
getNontransactionalRead()
Accessor for the nontransactionalRead flag for this transaction.
|
boolean |
getNontransactionalWrite()
Accessor for the nontransactionalWrite flag for this transaction.
|
boolean |
getOptimistic()
Accessor for the Optimistic setting
|
Map<String,Object> |
getOptions()
Obtain all settings for this Transaction
|
boolean |
getRestoreValues()
Accessor for the restoreValues flag for this transaction.
|
boolean |
getRetainValues()
Accessor for the retainValues flag for this transaction.
|
boolean |
getRollbackOnly()
Accessor for the "rollback only" flag.
|
Boolean |
getSerializeRead()
Accessor for the setting for whether to serialize read objects (lock them).
|
Synchronization |
getSynchronization()
Accessor for the synchronization object to be notified on transaction completion.
|
protected void |
internalBegin()
Method to begin the transaction.
|
protected void |
internalCommit()
Internal commit, DataNucleus invokes it's own transaction manager implementation, if
an external transaction manager is not used.
|
protected void |
internalPostCommit()
Method to perform any post-commit operations like calling the users "afterCompletion"
and general clean up after the commit.
|
protected void |
internalPreCommit()
Method to perform any pre-commit operations like flushing to the datastore, calling the users
"beforeCompletion", and general preparation for the commit.
|
protected void |
internalPreRollback() |
protected void |
internalRollback()
Internal rollback, DataNucleus invokes it's own transaction manager implementation, if
an external transaction manager is not used.
|
boolean |
isActive()
Accessor for whether the transaction is active.
|
boolean |
isCommitting()
Accessor for whether the transaction is comitting.
|
void |
preFlush()
Method to notify of preFlush.
|
void |
removeTransactionEventListener(TransactionEventListener listener)
Removes the specified listener.
|
void |
rollback()
Method to rollback the transaction.
|
void |
setNontransactionalRead(boolean nontransactionalRead)
Mutator for the setting of nontransactional read.
|
void |
setNontransactionalWrite(boolean nontransactionalWrite)
Mutator for the setting of nontransactional write.
|
void |
setOptimistic(boolean optimistic)
Mutator for the optimistic transaction setting.
|
void |
setOption(String option,
boolean value) |
void |
setOption(String option,
int value) |
void |
setOption(String option,
Object value) |
void |
setOption(String option,
String value) |
void |
setRestoreValues(boolean restoreValues)
Mutator for the setting of restore values.
|
void |
setRetainValues(boolean retainValues)
Mutator for the setting of retain values.
|
void |
setRollbackOnly()
Mutator for the "rollback only" flag.
|
void |
setSerializeRead(Boolean serializeRead)
Mutator for whether to serialize (lock) any read objects in this transaction.
|
void |
setSynchronization(Synchronization sync)
Mutator for the synchronization object to be notified on transaction completion.
|
protected static final Localiser LOCALISER
protected boolean rollbackOnly
protected Boolean serializeRead
public TransactionImpl(ExecutionContext ec)
ec - ExecutionContextpublic void close()
Transactionclose in interface Transactionpublic void begin()
begin in interface Transactionprotected void internalBegin()
public void preFlush()
preFlush in interface Transactionpublic void flush()
flush in interface Transactionpublic void end()
end in interface Transactionpublic void commit()
commit in interface Transactionprotected void internalPreCommit()
protected void internalCommit()
public void rollback()
rollback in interface Transactionprotected void internalPreRollback()
protected void internalRollback()
protected void internalPostCommit()
public boolean isActive()
isActive in interface Transactionpublic boolean getIsActive()
getIsActive in interface Transactionpublic boolean isCommitting()
isCommitting in interface Transactionpublic boolean getNontransactionalRead()
getNontransactionalRead in interface Transactionpublic boolean getNontransactionalWrite()
getNontransactionalWrite in interface Transactionpublic boolean getOptimistic()
getOptimistic in interface Transactionpublic boolean getRestoreValues()
getRestoreValues in interface Transactionpublic boolean getRetainValues()
getRetainValues in interface Transactionpublic boolean getRollbackOnly()
getRollbackOnly in interface Transactionpublic Synchronization getSynchronization()
getSynchronization in interface Transactionpublic void setNontransactionalRead(boolean nontransactionalRead)
setNontransactionalRead in interface TransactionnontransactionalRead - Whether to allow nontransactional read operationspublic void setNontransactionalWrite(boolean nontransactionalWrite)
setNontransactionalWrite in interface TransactionnontransactionalWrite - Whether to allow nontransactional write operationspublic void setOptimistic(boolean optimistic)
setOptimistic in interface Transactionoptimistic - The optimistic transaction setting.public void setRestoreValues(boolean restoreValues)
setRestoreValues in interface TransactionrestoreValues - Whether to restore values at commitpublic void setRetainValues(boolean retainValues)
setRetainValues in interface TransactionretainValues - Whether to retain values at commitpublic void setRollbackOnly()
setRollbackOnly in interface Transactionpublic void setSynchronization(Synchronization sync)
setSynchronization in interface Transactionsync - The synchronization object to be notified on transaction completionpublic void addTransactionEventListener(TransactionEventListener listener)
TransactionaddTransactionEventListener in interface Transactionpublic void removeTransactionEventListener(TransactionEventListener listener)
TransactionremoveTransactionEventListener in interface Transactionlistener - Listenerpublic void bindTransactionEventListener(TransactionEventListener listener)
TransactionbindTransactionEventListener in interface Transactionpublic Boolean getSerializeRead()
TransactiongetSerializeRead in interface Transactionpublic void setSerializeRead(Boolean serializeRead)
TransactionsetSerializeRead in interface TransactionserializeRead - Whether to serialise (lock) any read objectspublic Map<String,Object> getOptions()
TransactiongetOptions in interface Transactionpublic void setOption(String option, int value)
setOption in interface Transactionpublic void setOption(String option, boolean value)
setOption in interface Transactionpublic void setOption(String option, String value)
setOption in interface Transactionpublic void setOption(String option, Object value)
setOption in interface TransactionCopyright © 2013. All Rights Reserved.