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.