Win a copy of Learn Spring Security (video course) this week in the Spring forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

How to enlist XAResource

 
Roman Pavlov
Greenhorn
Posts: 9
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 3892
5
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Why not just use Session Synchronization? That's the J2EE standard way of doing this. There is no other supported mechanism.
Kyle
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic