|
IBM WebSphereTM eXtreme Scale, Release 8.6 API Specification |
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object com.ibm.websphere.objectgrid.plugins.builtins.WebSphereTransactionCallback
public class WebSphereTransactionCallback
A TransactionCallback plugin used to automatically enlist the ObjectGrid transaction as a volatile participant in a WebSphere JTA transaction. The ObjectGrid transaction is then called to "commit" or "rollback" its changes immediately after the two-phase commit stage of the JTA transaction. However, if the ObjectGrid transaction fails to commit or rollback, the failure does not affect the JTA transaction.
The WebSphereTransactionCallback provides an implementation of the isExternalTransactionActive
method to determine if a WebSphere Application Server transaction is active. If the method returns true,
ObjectGrid automatically begins an ObjectGrid transaction and when the WebSphere transaction
commits or rolls back, the ObjectGrid transaction will also be committed or rolled back.
This class may be extended to allow for application specific implementations to use the WebSphere transaction manager to control their ObjectGrid and other application resources together.
If this class is used outside of a WebSphere Application Server environment, the
isExternalTransactionActive
will return false.
Nested Class Summary |
---|
Nested classes/interfaces inherited from interface com.ibm.websphere.objectgrid.plugins.TransactionCallback |
---|
TransactionCallback.BeforeCommit |
Constructor Summary | |
---|---|
WebSphereTransactionCallback()
Deprecated. The default constructor. |
Method Summary | |
---|---|
void |
begin(TxID id)
Deprecated. Invoked when starting a Session transaction. |
void |
commit(TxID id)
Deprecated. Invoked when committing a Session transaction. |
void |
initialize(ObjectGrid objectGrid)
Deprecated. Invoked when an ObjectGrid is initialized. |
boolean |
isExternalTransactionActive(Session session)
Deprecated. This method returns true if a WebSphere JTA transaction is active. |
void |
rollback(TxID id)
Deprecated. Invoked when rolling back a Session transaction. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public WebSphereTransactionCallback()
Method Detail |
---|
public void begin(TxID id)
TransactionCallback
A TransactionCallback can communicate the begin processing (along with the TxID) to the appropriate BackingMap and/or Loader. The Loader may use this signal to start a corresponding transaction on the underlying connection to a database.
begin
in interface TransactionCallback
id
- transaction identifer (TxID)TransactionCallback.begin(com.ibm.websphere.objectgrid.TxID)
public void commit(TxID id)
TransactionCallback
This method should be used to commit any underlying transaction and return any underlying connection back to the pool. The TxID is provided to determine which transaction is being committed
commit
in interface TransactionCallback
id
- transaction identifier (TxID)TransactionCallback.commit(com.ibm.websphere.objectgrid.TxID)
public void initialize(ObjectGrid objectGrid)
TransactionCallback
ObjectGrid
is initialized.
This method is called so this object can do any implementation specific intialization.
initialize
in interface TransactionCallback
objectGrid
- A reference to the ObjectGrid.TransactionCallback.initialize(com.ibm.websphere.objectgrid.ObjectGrid)
public boolean isExternalTransactionActive(Session session)
true
if a WebSphere JTA transaction is active. If a problem
occurs in determining if a transaction is active, an ObjectGridRuntimeException will be thrown.
isExternalTransactionActive
in interface TransactionCallback
session
- the session which the application is using
true
if an auto begin should be done,
false
if this is not the case
ObjectGridRuntimeException
- thrown when any exception occurs. See the cause for the actual exception.TransactionCallback.isExternalTransactionActive(com.ibm.websphere.objectgrid.Session)
public void rollback(TxID id)
TransactionCallback
This method should be used to roll back any underlying transaction and return any underlying connection back to the pool. The TxID is provided to determine which transaction is being committed
rollback
in interface TransactionCallback
id
- transaction identifier (TxID)TransactionCallback.rollback(com.ibm.websphere.objectgrid.TxID)
|
IBM WebSphereTM eXtreme Scale, Release 8.6 API Specification |
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |