public class DelegatingTransactionHandler extends Object implements TransactionHandler
Constructor and Description |
---|
DelegatingTransactionHandler(TransactionHandler delegate) |
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
|
protected TransactionHandler |
getDelegate() |
<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 checkpointName)
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 DelegatingTransactionHandler(TransactionHandler delegate)
public void begin(Handle handle)
TransactionHandler
begin
in interface TransactionHandler
public void checkpoint(Handle handle, String name)
TransactionHandler
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)
TransactionHandler
commit
in interface TransactionHandler
protected TransactionHandler getDelegate()
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)
TransactionHandler
isInTransaction
in interface TransactionHandler
public void release(Handle handle, String checkpointName)
TransactionHandler
release
in interface TransactionHandler
handle
- the handle on which the checkpoint is being releasedcheckpointName
- the checkpoint to releasepublic void rollback(Handle handle)
TransactionHandler
rollback
in interface TransactionHandler
public void rollback(Handle handle, String name)
TransactionHandler
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.