| IBM WebSphere Extended Deployment (XD)TM
Release 6.0.1 |
The TransactionCallback can work with the Loaders and place transaction specific
objects in slots on the TxID object that the Loaders can obtain. Examples are
database connections, prepared statement caches etc. The TransactionCallback should
reserve slots in the TxID by calling ObjectGrid.reserveSlot using the name TxID.SLOT_NAME.
The TransactionCallback can then put an object at that index in the TxID. The Loader
can retrieve the index used by the TransactionCallback by calling a private method on the TransactionCallback
and a reference to that can be found using the TxID.getSession().getObjectGrid().getTransactionCallback()
code sequence.
See Also:
reserveSlot(String)putSlot(int, Object)getSlot(int)getSession()getObjectGrid()setTransactionCallback(TransactionCallback)getTransactionCallback()
Method Summary | |
---|---|
public
void | initialize(com.ibm.websphere.objectgrid.ObjectGrid)
This is a one time method called by the ObjectGrid to initialize this callback.
|
public
void | begin(com.ibm.websphere.objectgrid.TxID)
This method will be used when starting a cache-local transaction. The TransactionCallback.
|
public
void | commit(com.ibm.websphere.objectgrid.TxID)
The cache wants to commit the transaction and passes the begin state Object to the callee. The caller.
|
public
void | rollback(com.ibm.websphere.objectgrid.TxID)
This is called when the transaction rolls back.
|
public
boolean | isExternalTransactionActive(com.ibm.websphere.objectgrid.Session)
This is called when an application attempts to use a Session with no transaction active. The.
|
Method Detail |
public void initialize( | ObjectGrid objectGrid )
|
objectGrid
-
A reference to the ObjectGrid.
com.ibm.websphere.objectgrid.plugins.TransactionCallbackException
public void begin( | TxID id )
|
id
-
transaction identifer (TxID)
com.ibm.websphere.objectgrid.plugins.TransactionCallbackException
public void commit( | TxID id )
|
id
-
transaction identifier (TxID)
com.ibm.websphere.objectgrid.plugins.TransactionCallbackException
public void rollback( | TxID id )
|
id
-
transaction identifier (TxID)
com.ibm.websphere.objectgrid.plugins.TransactionCallbackException
public boolean isExternalTransactionActive( | Session session )
|
session
-
The session which the application is using
| IBM WebSphere Extended Deployment (XD)TM
Release 6.0.1 |