IBM WebSphereTM eXtreme Scale, Release 8.6
API Specification

com.ibm.websphere.objectgrid.plugins.builtins
Class WebSphereTransactionCallback

java.lang.Object
  extended by com.ibm.websphere.objectgrid.plugins.builtins.WebSphereTransactionCallback
All Implemented Interfaces:
TransactionCallback

Deprecated. This plug-in is deprecated in version 8.5. Use the eXtreme Scale Resource Adapter (wxsra.rar).

public class WebSphereTransactionCallback
extends Object
implements TransactionCallback

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.

Since:
WAS XD 6.1 FIX3, XC10

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

WebSphereTransactionCallback

public WebSphereTransactionCallback()
Deprecated. 
The default constructor.

Method Detail

begin

public void begin(TxID id)
Deprecated. 
Description copied from interface: TransactionCallback
Invoked when starting a Session transaction.

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.

Specified by:
begin in interface TransactionCallback
Parameters:
id - transaction identifer (TxID)
See Also:
TransactionCallback.begin(com.ibm.websphere.objectgrid.TxID)

commit

public void commit(TxID id)
Deprecated. 
Description copied from interface: TransactionCallback
Invoked when committing a Session transaction.

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

Specified by:
commit in interface TransactionCallback
Parameters:
id - transaction identifier (TxID)
See Also:
TransactionCallback.commit(com.ibm.websphere.objectgrid.TxID)

initialize

public void initialize(ObjectGrid objectGrid)
Deprecated. 
Description copied from interface: TransactionCallback
Invoked when an ObjectGrid is initialized.

This method is called so this object can do any implementation specific intialization.

Specified by:
initialize in interface TransactionCallback
Parameters:
objectGrid - A reference to the ObjectGrid.
See Also:
TransactionCallback.initialize(com.ibm.websphere.objectgrid.ObjectGrid)

isExternalTransactionActive

public boolean isExternalTransactionActive(Session session)
Deprecated. 
This method returns true if a WebSphere JTA transaction is active. If a problem occurs in determining if a transaction is active, an ObjectGridRuntimeException will be thrown.

Specified by:
isExternalTransactionActive in interface TransactionCallback
Parameters:
session - the session which the application is using
Returns:
true if an auto begin should be done, false if this is not the case
Throws:
ObjectGridRuntimeException - thrown when any exception occurs. See the cause for the actual exception.
See Also:
TransactionCallback.isExternalTransactionActive(com.ibm.websphere.objectgrid.Session)

rollback

public void rollback(TxID id)
Deprecated. 
Description copied from interface: TransactionCallback
Invoked when rolling back a Session transaction.

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

Specified by:
rollback in interface TransactionCallback
Parameters:
id - transaction identifier (TxID)
See Also:
TransactionCallback.rollback(com.ibm.websphere.objectgrid.TxID)

IBM WebSphereTM eXtreme Scale, Release 8.6
API Specification

© Copyright International Business Machines Corp 2005,2012. All rights reserved.