public final class ExecRecordWriter extends java.lang.Object implements TransactionListener
| Constructor and Description |
|---|
ExecRecordWriter(ConfigServiceImpl configService, int limit) |
| Modifier and Type | Method and Description |
|---|---|
void |
afterBegin(Transaction tr)
Invoked right after the transaction begins.
|
void |
afterEnd(Transaction tr)
Invoked after the transaction ends, namely, after the transaction fully commits or fully rolled back.
|
void |
beforeEnd(Transaction tr)
Invoked right before the transaction commits or rollsback.
|
void |
beforePrepare(Transaction tr)
Invoked right before the prepare phase starts.
|
java.lang.String |
getId()
Unique name for this transactional listener
|
boolean |
rollbackOnFailure()
Indicates whether exceptions from
TransactionListener.beforePrepare(com.bea.wli.config.transaction.Transaction) methods cause the transaction to rollback. |
public ExecRecordWriter(ConfigServiceImpl configService, int limit)
public java.lang.String getId()
TransactionListenergetId in interface TransactionListenerpublic boolean rollbackOnFailure()
TransactionListenerTransactionListener.beforePrepare(com.bea.wli.config.transaction.Transaction) methods cause the transaction to rollback.rollbackOnFailure in interface TransactionListenerTransactionListener.beforePrepare(com.bea.wli.config.transaction.Transaction) method raises exceptions; false otherwisepublic void afterBegin(Transaction tr)
TransactionListeneris called.
Exception behavior: While the implementations are not supposed to throw exceptions, any unchecked exception will cause the transaction to be abandoned and the caller of the beginTransaction method will get a TransactionException
This method is invoked under the TransactionManager lock.
afterBegin in interface TransactionListenerpublic void beforePrepare(Transaction tr) throws java.lang.Exception
TransactionListenerTransaction.Status.Active. However it is possible that the transaction may be marked as rollback-only (Transaction.Status.MarkedRollback) after this decision is made and the method is called. Therefore the implementations of this method should not rely on the fact that the transaction status is Transaction.Status.Active.
This method is NOT called if the transaction was marked for rollback only at the time of the decision.
This also implies that if a call to this method fails with an exception and the rollbackOnFailure flag is true for that listener (See TransactionListener.rollbackOnFailure()) , no beforePrepare method is called for the subsequent listeners.
This method is currently invoked outside the TransactionManager lock.
beforePrepare in interface TransactionListenerjava.lang.Exceptionpublic void beforeEnd(Transaction tr)
TransactionListenerTransaction.Status.Rollingback or Transaction.Status.Committing.
Exception behavior: While the implementations are not supposed to throw exceptions, any unchecked exception will be completely ignored. The remainder of the notifications are delivered normally.
This method is invoked under the TransactionManager lock.
beforeEnd in interface TransactionListenerpublic void afterEnd(Transaction tr)
TransactionListenerTransaction.Status.Rolledback or Transaction.Status.Committed.
This method is invoked under the TransactionManager lock.
afterEnd in interface TransactionListener