TRANSACTION
- is the generic type of the underlying native transaction.protected abstract class AbstractTransactionExecutor.AbstractTransactionAdapter<TRANSACTION> extends Object implements TransactionAdapter
TransactionAdapter
interface.Modifier and Type | Field and Description |
---|---|
private TRANSACTION |
activeTransaction |
private TransactionContext |
context |
Constructor and Description |
---|
AbstractTransactionAdapter()
The constructor.
|
Modifier and Type | Method and Description |
---|---|
void |
commit()
This method commits the current transaction without opening a new
transaction.
|
protected abstract TRANSACTION |
createNewTransaction()
This method creates a new technical transaction.
|
protected abstract void |
doCommit()
This method performs the actual
commit() on the active
transaction . |
protected abstract void |
doRollback()
This method performs the actual
rollback() on the active
transaction . |
protected TRANSACTION |
getActiveTransaction()
This method gets the underlying native transaction that is currently
active . |
TransactionContext |
getContext()
This method gets the
TransactionContext that allows to add
individual data to be associated with this TransactionAdapter . |
void |
interCommit()
This method
commits the transaction currently active and
opens a new one. |
boolean |
isActive()
This method determines if this context holds an active transaction.
|
void |
rollback()
This method performs a rollback of the current transaction.
|
protected void |
start()
This method has to be called after construction in order to start the transaction.
|
protected void |
stop()
This method has to be called at the end of the transactional execution to end transaction.
|
private final TransactionContext context
getContext()
private TRANSACTION activeTransaction
getActiveTransaction()
protected void start()
protected void stop()
protected abstract TRANSACTION createNewTransaction()
protected TRANSACTION getActiveTransaction() throws TransactionNotActiveException
active
.TransactionNotActiveException
- if there is no active
transaction.public boolean isActive()
TransactionAdapter.commit()
or TransactionAdapter.rollback()
was called
explicitly.isActive
in interface TransactionAdapter
true
if there is an active transaction or
false
otherwise.public TransactionContext getContext()
TransactionContext
that allows to add
individual data to be associated with this TransactionAdapter
.getContext
in interface TransactionAdapter
TransactionContext
.public void commit()
callable
but end with a commit rather than a
TransactionAdapter.rollback()
. commit
in interface TransactionAdapter
public void interCommit()
commits
the transaction currently active and
opens a new one. You should use this method for (recoverable) batches that
process large sets of data and therefore would overload if everything was
done in one technical transaction.interCommit
in interface TransactionAdapter
protected abstract void doCommit()
commit()
on the active
transaction
.public void rollback()
callable
without
committing
and or throwing an exception. rollback
in interface TransactionAdapter
protected abstract void doRollback()
rollback()
on the active
transaction
.Copyright © 2001–2016 mmm-Team. All rights reserved.