Hi
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:<192.168.141.1:2100>:1
2007-01-04 10:14:37,310 DEBUG - acquiring WL: fqn=/NODE_KEY,
caller=GlobalTransaction:<192.168.141.1:2100>:1, lock=read
owners=[GlobalTransaction:<192.168.141.1:2100>:1]
2007-01-04 10:14:37,310 DEBUG - upgrading RL to WL for
GlobalTransaction:<192.168.141.1:2100>:1, timeout=10000, locks: Read lock owners:
[GlobalTransaction:<192.168.141.1:2100>: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:<192.168.141.1:2100>:1, lock=write
owner=GlobalTransaction:<192.168.141.1:2100>:1
2007-01-04 10:14:37,310 ERROR - transaction entry not found for
(gtx=GlobalTransaction:<192.168.141.1:2100>: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!!!!
Jacek
View the original post :
http://www.jboss.com/index.html?module=bb&op=viewtopic&p=3997905#...
Reply to the post :
http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&a...