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)
Called when a transaction is started
|
void |
checkpoint(Handle handle,
String name)
Create a new checkpoint (savepoint in JDBC terminology)
|
void |
commit(Handle handle)
Called when a transaction is committed
|
<ReturnType> |
inTransaction(Handle handle,
TransactionCallback<ReturnType> callback)
Run a transaction.
|
<ReturnType> |
inTransaction(Handle handle,
TransactionIsolationLevel level,
TransactionCallback<ReturnType> callback)
Run a transaction.
|
boolean |
isInTransaction(Handle handle)
Called to test if a handle is in a transaction
|
void |
release(Handle handle,
String name)
Release a previously created checkpoint
|
void |
rollback(Handle handle)
Called when a transaction is rolled back
|
void |
rollback(Handle handle,
String name)
Roll back to a named checkpoint
|
public void begin(Handle handle)
begin
in interface TransactionHandler
public void checkpoint(Handle handle, String name)
checkpoint
in interface TransactionHandler
handle
- the handle on which the transaction is being checkpointedname
- The name of the chckpoint, used to rollback to or release latepublic void commit(Handle handle)
commit
in interface TransactionHandler
public <ReturnType> ReturnType inTransaction(Handle handle, TransactionCallback<ReturnType> callback)
TransactionHandler
inTransaction
in interface TransactionHandler
Handle.inTransaction(TransactionCallback)
public <ReturnType> ReturnType inTransaction(Handle handle, TransactionIsolationLevel level, TransactionCallback<ReturnType> callback)
TransactionHandler
inTransaction
in interface TransactionHandler
Handle.inTransaction(TransactionIsolationLevel, TransactionCallback)
public boolean isInTransaction(Handle handle)
isInTransaction
in interface TransactionHandler
public void release(Handle handle, String name)
TransactionHandler
release
in interface TransactionHandler
handle
- the handle on which the checkpoint is being releasedname
- the checkpoint to releasepublic void rollback(Handle handle)
rollback
in interface TransactionHandler
public void rollback(Handle handle, String name)
rollback
in interface TransactionHandler
handle
- the handle the rollback is being performed onname
- the name of the checkpoint to rollback toCopyright © 2018. All rights reserved.