public class LocalTransactionHandler extends Object implements TransactionHandler
TransactionHandler uses local JDBC transactions
demarcated explicitly on the handle and passed through to be handled
directly on the JDBC Connection instance.| Constructor and Description |
|---|
LocalTransactionHandler() |
| Modifier and Type | Method and Description |
|---|---|
void |
begin(Handle handle)
Begin a transaction.
|
void |
commit(Handle handle)
Commit the transaction.
|
<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) |
void |
releaseSavepoint(Handle handle,
String name)
Release a previously created savepoint.
|
void |
rollback(Handle handle)
Roll back the transaction.
|
void |
rollbackToSavepoint(Handle handle,
String name)
Roll back to a named savepoint.
|
void |
savepoint(Handle handle,
String name)
Create a new savepoint.
|
public void begin(Handle handle)
TransactionHandlerbegin in interface TransactionHandlerhandle - the handle the transaction is being started onpublic void commit(Handle handle)
TransactionHandlercommit 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 name)
TransactionHandlerreleaseSavepoint in interface TransactionHandlerhandle - the handle on which the savepoint is being releasedname - the savepoint to releasepublic void rollback(Handle handle)
TransactionHandlerrollback in interface TransactionHandlerhandle - the handle the rollback is being performed onpublic void rollbackToSavepoint(Handle handle, String name)
TransactionHandlerrollbackToSavepoint 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)
TransactionHandlersavepoint in interface TransactionHandlerhandle - the handle on which the transaction is being savepointedname - The name of the savepoint, used to rollback to or release laterCopyright © 2019. All rights reserved.