File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
The moose likes Websphere and the fly likes How to enlist XAResource Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Products » Websphere
Bookmark "How to enlist XAResource " Watch "How to enlist XAResource " New topic

How to enlist XAResource

Roman Pavlov

Joined: Feb 26, 2003
Posts: 9
Hi, we are migrating from weblogic6.1 to was5.
One of application caches uses XAResource enlisted to session bean transaction. It helps to detect end of session and delete information about user from the cache. (Xid of the transaction is the key in HashTable)
I can't find documentation about enlisting XAResource in WAS. I decompiled several jar files and found WebSphereTransactionManager and TransactionManagerFactory classes but it didn't help much.
This is weblogic code:
weblogic.transaction.TransactionManager tm = weblogic.transaction.TxHelper.getTransactionManager();
if ( statically )
{tm.registerStaticResource( name, resource );
{tm.registerDynamicResource( name, resource );
I try to enlist resource excplicitly in WAS but it throws IllegalStateException.
WebSphereTransactionManager tm = TransactionManagerFactory.getTransactionManager();
Logger.getGenericLog().debug(" LauncherBean.startUp transaction Status = " + tm.getStatus());
Transaction tr = tm.getTransaction();
tr.enlistResource( resource );
Despite transaction status is 0 (Active)
is thrown.
Can anybody explain how to resgister (or enlist)XAResource in WAS. If you have usefull urls,please, post them here.
Kyle Brown
Ranch Hand

Joined: Aug 10, 2001
Posts: 3892
Why not just use Session Synchronization? That's the J2EE standard way of doing this. There is no other supported mechanism.

Kyle Brown, Author of Persistence in the Enterprise and Enterprise Java Programming with IBM Websphere, 2nd Edition
See my homepage at for other WebSphere information.
I agree. Here's the link:
subject: How to enlist XAResource
It's not a secret anymore!