aspose file tools*
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


Win a copy of EJB 3 in Action this week in the EJB and other Java EE Technologies forum!
JavaRanch » Java Forums » Products » Websphere
Bookmark "How to enlist XAResource " Watch "How to enlist XAResource " New topic
Author

How to enlist XAResource

Roman Pavlov
Greenhorn

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 );
}
else
{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)
java.lang.IllegalStateException
at com.ibm.ejs.jts.jta.TransactionImpl.enlistResource(TransactionImpl.java:444)
at com.netcracker.ejb.session.security.LauncherBean.startup(LauncherBean.java:81)
is thrown.
Can anybody explain how to resgister (or enlist)XAResource in WAS. If you have usefull urls,please, post them here.
Kyle Brown
author
Ranch Hand

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


Kyle Brown, Author of Persistence in the Enterprise and Enterprise Java Programming with IBM Websphere, 2nd Edition
See my homepage at http://www.kyle-brown.com/ for other WebSphere information.
 
With a little knowledge, a cast iron skillet is non-stick and lasts a lifetime.
 
subject: How to enlist XAResource
 
Similar Threads
BMT bean setRollbackOnly
Could not enlist in transaction on entering meta-aware object
XA DataSource configuration Error/Exception in JBoss
JTA Problem--The Xid is not valid
help needed