public abstract class Synchronization extends SPI
Note: logical transactions provide a containment scope only - resource enlistment and coordination with resource manager JTA transactions is not provided.
Rollback is initiated in the following ways:
When rollback is triggered, the following actions are taken:
Implement the Synchronization SPI, by extending this class and implementing the begin, beforeCompletion, afterCompletion, and rollBack methods.
Configure this SPI with the following declaration in the xd.spi.properties file:
spi.parallel.logicalTX.Synchronization=<fully-qualified implementation class name>
Notes:
<WAS install root>/properties. E.g.
/WebSphere/AppServer/properties
<WAS install root>/lib/classes. E.g.
/WebSphere/AppServer/lib/classes
| Modifier and Type | Class and Description |
|---|---|
static class |
Synchronization.TXStatus
Specifies status values for logical transaction outcome.
|
| Modifier and Type | Field and Description |
|---|---|
static boolean |
TX_NOT_RESTARTABLE
Specifies that the logical transaction is not restartable.
|
static boolean |
TX_RESTARTABLE
Specifies that the logical transaction is restartable.
|
| Constructor and Description |
|---|
Synchronization() |
| Modifier and Type | Method and Description |
|---|---|
abstract void |
afterCompletion(java.lang.String logicalTXID,
Synchronization.TXStatus status)
Indicates the specified logical transaction has completed with the indicated status.
|
abstract void |
beforeCompletion(java.lang.String logicalTXID)
Indicates all subjobs have ended and that the specified logical transaction is about
to commit.
|
abstract void |
begin(java.lang.String logicalTXID)
Indicates the specified logical transaction has begun.
|
java.lang.String |
getName()
Returns the name of this SPI instance.
|
abstract com.ibm.wsspi.batch.parallel.logicalTX.RestartInstructions |
rollBack(java.lang.String logicalTXID,
boolean restartable)
Invoked to undo changes made by subjobs within the unit of work scope of the specified logical
transaction.
|
compareTo, getInvocationOrder, setInvocationOrder, toStringpublic static boolean TX_RESTARTABLE
public static boolean TX_NOT_RESTARTABLE
public abstract void begin(java.lang.String logicalTXID)
logicalTXID - specifies the unique identity of the logical transaction.public abstract void beforeCompletion(java.lang.String logicalTXID)
throws com.ibm.wsspi.batch.parallel.logicalTX.RollbackLogicalTXException
logicalTXID - specifies the unique identity of the logical transaction.com.ibm.wsspi.batch.parallel.logicalTX.RollbackLogicalTXExceptionpublic abstract void afterCompletion(java.lang.String logicalTXID,
Synchronization.TXStatus status)
logicalTXID - specifies the unique identity of the logical transaction.status - specifies the outcome of the logical transaction - either COMMIT or ROLLBACKpublic abstract com.ibm.wsspi.batch.parallel.logicalTX.RestartInstructions rollBack(java.lang.String logicalTXID,
boolean restartable)
logicalTXID - specifies the unique identity of the logical transaction.restartable - specifies whether or not this logical transaction is restartable as
follows: