[jboss-user] [JBossCache] - Problem with transaction timeout [critical]

jacek187 do-not-reply at jboss.com
Thu Jan 4 08:15:42 EST 2007


I'm using latest TreeCache 1.4.0SP1 with WebLogic 9.1.
There is a problem with transaction timeout. On WebLogic, when transaction timeouts server is dooing transacion synchronization in separate thread.... 
It causes problems with following scenario:

1. Thread A is invoking transactional method foo() (in SLSB etc). New transaction starts with timeout 30 sec.
2. Method foo() is making call into DB, putting/getting data from/into TreeCache and making businness operations. This is long runing method (60sec)
3. On end foo() method server is trying commit transaction, but this transaction is timed out, so now server start separate thread Y. Thread Y is making call into OrderedSynchronizationHandler.afterCompletion() synchronization handler. Main thred X is calling main code.

And this is problem, because in main looks like:

  | 		try{
  | 			FooManager.foo();
  | 		}catch(RuntimeException e){
  | 			logger.error("Exception catched:",e);
  | 		}
  | 		TreeCacheUtils.putIntoCache("KEY", "VALUE");
any exception from foo() method is catched and logged, and any next eny variable is putted into cache (and view with error  message is rendered etc)

But there is a hazrd risk, because sometimes main code is making operation on TreeCache BEFORE thread Y is calling afterCompletion method!!!!!!

this causes unexpected effect, because TreeCache has still information about GloblTransaction (information about transactions is yet not updated in TXInterceptor). TreeCache is trying lock node with information about caller GlobalTransaction, but this transaction dosen't exist for weblogic TransactionManager!
And now when we looks in TreeCache logs we can see, that write lock is aquired and NEVER RELEASED!!!!!!!

2007-01-04 10:14:37,310 DEBUG  - Attempting to lock node /NODE_KEY for owner GlobalTransaction:<>:1
2007-01-04 10:14:37,310 DEBUG  - acquiring WL: fqn=/NODE_KEY, caller=GlobalTransaction:<>:1, lock=read owners=[GlobalTransaction:<>:1]
2007-01-04 10:14:37,310 DEBUG  - upgrading RL to WL for GlobalTransaction:<>:1, timeout=10000, locks: Read lock owners: [GlobalTransaction:<>:1]
Write lock owner: null

2007-01-04 10:14:37,310 DEBUG  - upgrading lock for /NODE_KEY
2007-01-04 10:14:37,310 DEBUG  - acquired WL: fqn=/NODE_KEY, caller=GlobalTransaction:<>:1, lock=write owner=GlobalTransaction:<>:1
2007-01-04 10:14:37,310 ERROR  - transaction entry not found for (gtx=GlobalTransaction:<>:1)
2007-01-04 10:14:37,310 DEBUG  - Invoking method _put(null, /NODE_KEY, NODE_VALUE, Thu Jan 04 10:14:37 CET 2007, true) on cache.
2007-01-04 10:14:37,310 DEBUG  - _put(null, "/NODE_KEY", NODE_VALUE, Thu Jan 04 10:14:37 CET 2007)
2007-01-04 10:14:37,310 DEBUG  - Attempting to release locks on current thread.  Lock table is {} 

This is critical bug for me, because from now any operation on NODE_KEY causes org.jboss.cache.lock.TimeoutException: failure acquiring lock exception!
And i must restart server!!!!


View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=3997905#3997905

Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=3997905

More information about the jboss-user mailing list