IllegalStateException: "removing bean lock and it has tx set
bartee Mar 27, 2002 11:36 AMHi,
We are using JBoss2.4.3 on Solaris/Windows2000 and JDK1.3.1.
In our code we are accessing an entity bean from within a statelss session bean using local ejb references conforming to EJB 1.1 spec. The deployment descriptor block for our entity bean is shown below.
<ejb-name>com.artesia.property.enumMap.EnumMapHome</ejb-name>
com.artesia.property.enumMap.EnumMapHome
com.artesia.property.enumMap.EnumMapRemote
<ejb-class>com.artesia.property.enumMap.EnumMapEJB</ejb-class>
<persistence-type>Bean</persistence-type>
<prim-key-class>com.artesia.property.enumMap.EnumMapPK</prim-key-class>
False
We don't specify any transaction attributes for this entity bean methods. Can you tell me what the default attribute is?
In any case, after running the server for a little while we encounter a stack trace as shown below:
[EnumMapHome] TRANSACTION ROLLBACK EXCEPTION:removing bean lock and it has tx set!; nested exception i
s:
java.lang.IllegalStateException: removing bean lock and it has tx set!
[EnumMapHome] java.lang.IllegalStateException: removing bean lock and it has tx set!
[EnumMapHome] at org.jboss.ejb.plugins.lock.QueuedPessimisticEJBLock.removeRef(QueuedPessimisticEJBL
ock.java:447)
[EnumMapHome] at org.jboss.ejb.BeanLockManager.removeLockRef(BeanLockManager.java:79)
[EnumMapHome] at org.jboss.ejb.plugins.EntityLockInterceptor.invoke(EntityLockInterceptor.java:153)
[EnumMapHome] at org.jboss.ejb.plugins.TxInterceptorCMT.invokeNext(TxInterceptorCMT.java:133)
[EnumMapHome] at org.jboss.ejb.plugins.TxInterceptorCMT.runWithTransactions(TxInterceptorCMT.java:30
7)
[EnumMapHome] at org.jboss.ejb.plugins.TxInterceptorCMT.invoke(TxInterceptorCMT.java:99)
[EnumMapHome] at org.jboss.ejb.plugins.SecurityInterceptor.invoke(SecurityInterceptor.java:128)
[EnumMapHome] at org.jboss.ejb.plugins.LogInterceptor.invoke(LogInterceptor.java:195)
[EnumMapHome] at org.jboss.ejb.EntityContainer.invoke(EntityContainer.java:427)
[EnumMapHome] at org.jboss.ejb.plugins.jrmp.server.JRMPContainerInvoker.invoke(JRMPContainerInvoker.
java:489)
[EnumMapHome] at org.jboss.ejb.plugins.jrmp.interfaces.GenericProxy.invokeContainer(GenericProxy.jav
a:335)
[EnumMapHome] at org.jboss.ejb.plugins.jrmp.interfaces.EntityProxy.invoke(EntityProxy.java:133)
[EnumMapHome] at $Proxy35.getCodeToNameMap(Unknown Source)
[EnumMapHome] at com.artesia.property.db.PropertyContainer.convertToProperties(PropertyContainer.jav
a:393)
[EnumMapHome] at com.artesia.property.db.PropertyContainer.getProperties(PropertyContainer.java:210)
[EnumMapHome] at com.artesia.property.db.d.a(d.java)
[EnumMapHome] at com.artesia.property.db.a.writeToDb(a.java)
[EnumMapHome] at com.artesia.property.db.ValueEditorHandler.populateProperties(ValueEditorHandler.ja
va)
[EnumMapHome] at com.artesia.property.manager.PropertyManagerHelper.addProperties(PropertyManagerHel
per.java)
[EnumMapHome] at com.artesia.property.manager.PropertyManagerEJB.addProperties(PropertyManagerEJB.ja
va)
As you can see from the stack trace, PropertyManagerEJB is our stateless session bean. It is configured to have Bean-managed transactions and we do not start a transaction programmatically. When it attempts to invoke a method on the entity bean after locating it we encounter this stack trace. We found similar issues in your forum an d one of the answers implied that our PK class might be at fault in its equals and hashcode methods. We double-checked it and it seems to be OK. We are confused and any help on this issue would be appreciated..
-bharathi
Principal Software Engr.
Artesia Technologies.