0 Replies Latest reply on Nov 5, 2007 4:41 PM by errobins

    removing bean lock and it has tx set

    errobins

      I am using jboss-4.2.1 on linux (2.6.9-55.0.6) with the jdk1.5.0_12 release. My application makes extensive use of Stateless Session Beans and CMP Entity Beans (both version 2.1). I am using a custom container configuration that is based on the "Standard CMP 2.x EntityBean" container configuration, but uses commit option A.

      Under load/transactional contention, I am encountering the "removing bean lock and it has tx set" IllegalStateException. The documentation states that this error is usually the result of an incorrectly implemented primary key class. I do not believe that this is what is causing my error for two reasons:

      1) My pk classes are generated by xdoclet (version 1.2.3, after they fixed the bugs related to incorrect pk class generation) and I have examined them closely and run unit tests on them and they seem to work just fine.

      2) The IllegalStateExceptions do not occur at predictable points during execution. They seem to occur almost randomly - though only when there is transactional contention on a bean. Also, the exceptions are thrown *MUCH* more frequently on a four processor machine (pretty often) than they are on a single processor machine (almost never).

      I have turned on trace logging and have observed that the error is typically thrown after the trace log message documenting the end of the call to EntityInstanceInterceptor.invoke() but before the trace log message documenting the end of the EntityLockInterceptor.invoke() method (i.e., it seems to be occurring in the removeLockRef() call in the last finally block in the EntityLockInterceptor.invoke() method. The very strange thing is that in the action on this bean immediately prior to the one that causes the error, I see the EntityInstanceInterceptor end invoke message followed by the EntityLockInterceptor end invoke message, but with no intervening removing lock ref message (and no errors or exception reported in there either). This i sstrange to me, because I do not understand why that remove lock ref message would not be hitting the log since the two messages on either side of it are.

      I can provide a snippet from the relevant section of the log if anyone would find it useful.

      Any help is greatly appreciated.

      Thank you!