public class CMTTransactionHandler extends Object implements TransactionHandler
| Constructor and Description |
|---|
CMTTransactionHandler() |
| Modifier and Type | Method and Description |
|---|---|
void |
begin(Handle handle)
Called when a transaction is started
|
void |
commit(Handle handle)
Called when a transaction is committed
|
<R,X extends Exception> |
inTransaction(Handle handle,
HandleCallback<R,X> callback)
Run a transaction.
|
<R,X extends Exception> |
inTransaction(Handle handle,
TransactionIsolationLevel level,
HandleCallback<R,X> callback)
Run a transaction.
|
boolean |
isInTransaction(Handle handle)
Called to test if a handle is in a transaction
|
void |
releaseSavepoint(Handle handle,
String savepointName)
Savepoints are not supported.
|
void |
rollback(Handle handle)
Called when a transaction is rolled back
Will throw a RuntimeException to force transactional rollback
|
void |
rollbackToSavepoint(Handle handle,
String name)
Savepoints are not supported.
|
void |
savepoint(Handle handle,
String name)
Savepoints are not supported.
|
public void begin(Handle handle)
begin in interface TransactionHandlerhandle - the handle the transaction is being started onpublic void commit(Handle handle)
commit in interface TransactionHandlerhandle - the handle the commit is being performed onpublic <R,X extends Exception> R inTransaction(Handle handle, HandleCallback<R,X> callback) throws X extends Exception
TransactionHandlerinTransaction in interface TransactionHandlerR - the callback return typeX - the exception type thrown by the callback, if anyhandle - the handle to the databasecallback - a callback which will receive the open handle, in a transaction.X - any exception thrown by the callback.X extends ExceptionHandle.inTransaction(HandleCallback)public <R,X extends Exception> R inTransaction(Handle handle, TransactionIsolationLevel level, HandleCallback<R,X> callback) throws X extends Exception
TransactionHandlerinTransaction in interface TransactionHandlerR - the callback return typeX - the exception type thrown by the callback, if anyhandle - the handle to the databaselevel - the isolation level for the transactioncallback - a callback which will receive the open handle, in a transaction.X - any exception thrown by the callback.X extends ExceptionHandle.inTransaction(TransactionIsolationLevel, HandleCallback)public boolean isInTransaction(Handle handle)
isInTransaction in interface TransactionHandlerhandle - the handle to testpublic void releaseSavepoint(Handle handle, String savepointName)
releaseSavepoint in interface TransactionHandlerhandle - the handle on which the savepoint is being releasedsavepointName - the savepoint to releasepublic void rollback(Handle handle)
rollback in interface TransactionHandlerhandle - the handle the rollback is being performed onpublic void rollbackToSavepoint(Handle handle, String name)
rollbackToSavepoint in interface TransactionHandlerhandle - the handle the rollback is being performed onname - the name of the savepoint to rollback topublic void savepoint(Handle handle, String name)
savepoint in interface TransactionHandlerhandle - the handle on which the transaction is being savepointedname - The name of the savepoint, used to rollback to or release laterCopyright © 2017. All rights reserved.