Bugs item #582428, was opened at 2002-07-16 22:33 You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=376685&aid=582428&group_id=22866
Category: JBossServer Group: v3.0 Rabbit Hole Status: Open Resolution: None Priority: 5 Submitted By: Andrew Lau (andrewlau4) Assigned to: Bill Burke (patriot1burke) Summary: ejb remove cause IllegalStateException Initial Comment: This problem happens in jboss 3.0 and 3.0.1 RC1 I have a parent entity bean that I have set to 'cascade delete' all its children. But when I try to remove that bean, I sometimes got the following exception: ............. java.lang.IllegalStateException: removing bean lock and it has tx set! at org.jboss.ejb.plugins.lock.QueuedPessimisticEJBLock.r emoveRef(QueuedPessimisticEJBLock.java:469) at org.jboss.ejb.BeanLockManager.removeLockRef (BeanLockManager.java:78) at org.jboss.ejb.plugins.EntityLockInterceptor.invoke (EntityLockInterceptor.java:124) at org.jboss.ejb.plugins.EntityCreationInterceptor.invoke (EntityCreationInterceptor.java:69) at org.jboss.ejb.plugins.AbstractTxInterceptor.invokeNext (AbstractTxInterceptor.java:96) at org.jboss.ejb.plugins.TxInterceptorCMT.runWithTransacti ons(TxInterceptorCMT.java:167) at org.jboss.ejb.plugins.TxInterceptorCMT.invoke (TxInterceptorCMT.java:61) at org.jboss.ejb.plugins.SecurityInterceptor.invoke (SecurityInterceptor.java:129) at org.jboss.ejb.plugins.LogInterceptor.invoke (LogInterceptor.java:166) at org.jboss.ejb.EntityContainer.invoke (EntityContainer.java:493) at org.jboss.ejb.plugins.cmp.jdbc.bridge.JDBCCMRFieldBri dge.invokeRemoveRelation (JDBCCMRFieldBridge.java:759) at org.jboss.ejb.plugins.cmp.jdbc.bridge.JDBCCMRFieldBri dge.destroyRelationLinks (JDBCCMRFieldBridge.java:696) at org.jboss.ejb.plugins.cmp.jdbc.bridge.JDBCCMRFieldBri dge.destroyRelationLinks (JDBCCMRFieldBridge.java:674) at org.jboss.ejb.plugins.cmp.jdbc.bridge.RelationSet.clear (RelationSet.java:163) ...... But I may have found a quick solution for now. The IllegalStateException exception only happens when I call EJBLocalObject remove() method. Now I changed my code so it calls EJBLocalHome remove() method instead. Since then, it seems working fine so far. ---------------------------------------------------------------------- Comment By: Alexei Yudichev (sflexus) Date: 2002-10-15 14:49 Message: Logged In: YES user_id=345880 Today I first time saw the same error while ADDING (not removing) entity to relation (see below, C6808080808080808080808080806B80 is entity's PK). Is there any estimation when it can be fixed?.. 2002- 10-15 14:41:36,642 ERROR [org.jboss.ejb.plugins.LogInterceptor] TransactionRolledbackLocalException, causedBy: java.lang.IllegalStateException: removing bean lock and it has tx set!StoreCategory C6808080808080808080808080806B80 at org.jboss.ejb.plugins.lock.QueuedPessimisticEJBLock.removeRef(QueuedPessimisticEJBLock.java:412) at org.jboss.ejb.BeanLockManager.removeLockRef(BeanLockManager.java:103) at org.jboss.ejb.plugins.EntityLockInterceptor.invoke(EntityLockInterceptor.java:124) at org.jboss.ejb.plugins.EntityCreationInterceptor.invoke(EntityCreationInterceptor.java:69) at org.jboss.ejb.plugins.AbstractTxInterceptor.invokeNext(AbstractTxInterceptor.java:107) at org.jboss.ejb.plugins.TxInterceptorCMT.runWithTransactions(TxInterceptorCMT.java:232) at org.jboss.ejb.plugins.TxInterceptorCMT.invoke(TxInterceptorCMT.java:60) at org.jboss.ejb.plugins.SecurityInterceptor.invoke(SecurityInterceptor.java:130) at org.jboss.ejb.plugins.LogInterceptor.invoke(LogInterceptor.java:203) at org.jboss.ejb.EntityContainer.invoke(EntityContainer.java:493) at org.jboss.ejb.plugins.cmp.jdbc.bridge.JDBCCMRFieldBridge.invokeAddRelation(JDBCCMRFieldBridge.java:676) at org.jboss.ejb.plugins.cmp.jdbc.bridge.JDBCCMRFieldBridge.createRelationLinks(JDBCCMRFieldBridge.java:587) at org.jboss.ejb.plugins.cmp.jdbc.bridge.JDBCCMRFieldBridge.setInstanceValue(JDBCCMRFieldBridge.java:551) at org.jboss.ejb.plugins.cmp.jdbc.bridge.JDBCCMRFieldBridge.setValue(JDBCCMRFieldBridge.java:483) at org.jboss.ejb.plugins.cmp.bridge.EntityBridgeInvocationHandler.invoke(EntityBridgeInvocationHandler.java:126) at org.jboss.proxy.compiler.Runtime.invoke(Runtime.java:59) at com.tw.mms.ejb.MMSImageBean$Proxy.setStoreCategories(<generated>) at com.tw.mms.ejb.MMSObject.ejbPostCreateInCategory(MMSObject.java:31) at com.tw.mms.ejb.MMSImageBean.ejbPostCreateInCategory(MMSImageBean.java:44) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25) at java.lang.reflect.Method.invoke(Method.java:324) at org.jboss.ejb.plugins.CMPPersistenceManager.postCreateEntity(CMPPersistenceManager.java:284) at org.jboss.resource.connectionmanager.CachedConnectionInterceptor.postCreateEntity(CachedConnectionInterceptor.java:278) at org.jboss.ejb.EntityContainer.postCreateHome(EntityContainer.java:719) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25) at java.lang.reflect.Method.invoke(Method.java:324) at org.jboss.ejb.EntityContainer$ContainerInterceptor.invoke(EntityContainer.java:1173) at org.jboss.ejb.plugins.cmp.jdbc.JDBCRelationInterceptor.invoke(JDBCRelationInterceptor.java:95) at org.jboss.ejb.plugins.EntitySynchronizationInterceptor.invoke(EntitySynchronizationInterceptor.java:308) at org.jboss.resource.connectionmanager.CachedConnectionInterceptor.invoke(CachedConnectionInterceptor.java:186) at org.jboss.ejb.plugins.EntityReentranceInterceptor.invoke(EntityReentranceInterceptor.java:90) at org.jboss.ejb.plugins.EntityInstanceInterceptor.invoke(EntityInstanceInterceptor.java:152) at org.jboss.ejb.plugins.EntityLockInterceptor.invoke(EntityLockInterceptor.java:107) at org.jboss.ejb.plugins.EntityCreationInterceptor.invokeHome(EntityCreationInterceptor.java:59) at org.jboss.ejb.plugins.AbstractTxInterceptor.invokeNext(AbstractTxInterceptor.java:111) at org.jboss.ejb.plugins.TxInterceptorCMT.runWithTransactions(TxInterceptorCMT.java:178) at org.jboss.ejb.plugins.TxInterceptorCMT.invokeHome(TxInterceptorCMT.java:52) at org.jboss.ejb.plugins.SecurityInterceptor.invokeHome(SecurityInterceptor.java:105) at org.jboss.ejb.plugins.LogInterceptor.invokeHome(LogInterceptor.java:129) at org.jboss.ejb.EntityContainer.invokeHome(EntityContainer.java:487) at org.jboss.ejb.Container.invoke(Container.java:730) at org.jboss.ejb.EntityContainer.invoke(EntityContainer.java:1058) at org.jboss.mx.server.MBeanServerImpl.invoke(MBeanServerImpl.java:517) at org.jboss.invocation.jrmp.server.JRMPInvoker.invoke(JRMPInvoker.java:381) at sun.reflect.GeneratedMethodAccessor33.invoke(Unknown Source) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25) at java.lang.reflect.Method.invoke(Method.java:324) at sun.rmi.server.UnicastServerRef.dispatch(UnicastServerRef.java:261) at sun.rmi.transport.Transport$1.run(Transport.java:148) at java.security.AccessController.doPrivileged(Native Method) at sun.rmi.transport.Transport.serviceCall(Transport.java:144) at sun.rmi.transport.tcp.TCPTransport.handleMessages(TCPTransport.java:460) at sun.rmi.transport.tcp.TCPTransport$ConnectionHandler.run(TCPTransport.java:701) at java.lang.Thread.run(Thread.java:536) ---------------------------------------------------------------------- Comment By: Alexei Yudichev (sflexus) Date: 2002-09-17 11:05 Message: Logged In: YES user_id=345880 This exception MAY (or may not) happen when children are being removed from relation either expicitly by calling cmr setXXX method or implicitly by removing children or the parent. ---------------------------------------------------------------------- Comment By: Alexei Yudichev (sflexus) Date: 2002-09-12 12:39 Message: Logged In: YES user_id=345880 Also it happens sometimes when I try to invoke cmr set method with many-to-one relationship. Is this bug about to be fixed in nearest future? Because otherwise I will have to move our project from jboss or from ejb 2.0 and it will take much time. 2002-09-12 12:29:08,719 ERROR [org.jboss.ejb.plugins.LogInterceptor] TransactionRolledbackLocalException, causedBy: java.lang.IllegalStateException: removing bean lock and it has tx set! at org.jboss.ejb.plugins.lock.QueuedPessimisticEJBLock.removeRef(QueuedPessimisticEJBLock.java:473) at org.jboss.ejb.BeanLockManager.removeLockRef(BeanLockManager.java:78) at org.jboss.ejb.plugins.EntityLockInterceptor.invoke(EntityLockInterceptor.java:124) at org.jboss.ejb.plugins.EntityCreationInterceptor.invoke(EntityCreationInterceptor.java:69) at org.jboss.ejb.plugins.AbstractTxInterceptor.invokeNext(AbstractTxInterceptor.java:107) at org.jboss.ejb.plugins.TxInterceptorCMT.runWithTransactions(TxInterceptorCMT.java:232) at org.jboss.ejb.plugins.TxInterceptorCMT.invoke(TxInterceptorCMT.java:60) at org.jboss.ejb.plugins.SecurityInterceptor.invoke(SecurityInterceptor.java:130) at org.jboss.ejb.plugins.LogInterceptor.invoke(LogInterceptor.java:203) at org.jboss.ejb.EntityContainer.invoke(EntityContainer.java:493) at org.jboss.ejb.plugins.cmp.jdbc.bridge.JDBCCMRFieldBridge.invokeGetRelatedId(JDBCCMRFieldBridge.java:640) at org.jboss.ejb.plugins.cmp.jdbc.bridge.JDBCCMRFieldBridge.createRelationLinks(JDBCCMRFieldBridge.java:570) at org.jboss.ejb.plugins.cmp.jdbc.bridge.JDBCCMRFieldBridge.setInstanceValue(JDBCCMRFieldBridge.java:545) at org.jboss.ejb.plugins.cmp.jdbc.bridge.JDBCCMRFieldBridge.setValue(JDBCCMRFieldBridge.java:483) at org.jboss.ejb.plugins.cmp.bridge.EntityBridgeInvocationHandler.invoke(EntityBridgeInvocationHandler.java:125) at org.jboss.proxy.compiler.Runtime.invoke(Runtime.java:59) at com.tw.mms.ejb.SlideBean$Proxy.setSound(<generated>) at com.tw.mms.ejb.SlideBean.setSoundId(SlideBean.java:185) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25) at java.lang.reflect.Method.invoke(Method.java:324) at org.jboss.ejb.EntityContainer$ContainerInterceptor.invoke(EntityContainer.java:1191) at org.jboss.ejb.plugins.cmp.jdbc.JDBCRelationInterceptor.invoke(JDBCRelationInterceptor.java:95) at org.jboss.ejb.plugins.EntitySynchronizationInterceptor.invoke(EntitySynchronizationInterceptor.java:308) at org.jboss.resource.connectionmanager.CachedConnectionInterceptor.invoke(CachedConnectionInterceptor.java:186) at org.jboss.ejb.plugins.EntityInstanceInterceptor.invoke(EntityInstanceInterceptor.java:152) at org.jboss.ejb.plugins.EntityLockInterceptor.invoke(EntityLockInterceptor.java:107) at org.jboss.ejb.plugins.EntityCreationInterceptor.invoke(EntityCreationInterceptor.java:69) at org.jboss.ejb.plugins.AbstractTxInterceptor.invokeNext(AbstractTxInterceptor.java:107) at org.jboss.ejb.plugins.TxInterceptorCMT.runWithTransactions(TxInterceptorCMT.java:178) at org.jboss.ejb.plugins.TxInterceptorCMT.invoke(TxInterceptorCMT.java:60) at org.jboss.ejb.plugins.SecurityInterceptor.invoke(SecurityInterceptor.java:130) at org.jboss.ejb.plugins.LogInterceptor.invoke(LogInterceptor.java:203) at org.jboss.ejb.EntityContainer.invoke(EntityContainer.java:493) at org.jboss.ejb.Container.invoke(Container.java:720) at org.jboss.ejb.EntityContainer.invoke(EntityContainer.java:1055) at org.jboss.mx.server.MBeanServerImpl.invoke(MBeanServerImpl.java:517) at org.jboss.invocation.jrmp.server.JRMPInvoker.invoke(JRMPInvoker.java:370) at sun.reflect.GeneratedMethodAccessor54.invoke(Unknown Source) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25) at java.lang.reflect.Method.invoke(Method.java:324) at sun.rmi.server.UnicastServerRef.dispatch(UnicastServerRef.java:261) at sun.rmi.transport.Transport$1.run(Transport.java:148) at java.security.AccessController.doPrivileged(Native Method) at sun.rmi.transport.Transport.serviceCall(Transport.java:144) at sun.rmi.transport.tcp.TCPTransport.handleMessages(TCPTransport.java:460) at sun.rmi.transport.tcp.TCPTransport$ConnectionHandler.run(TCPTransport.java:701) at java.lang.Thread.run(Thread.java:536) ---------------------------------------------------------------------- Comment By: Alexei Yudichev (sflexus) Date: 2002-09-12 10:57 Message: Logged In: YES user_id=345880 I use 3.0.2 and for me it happens every time I remove cmp20 bean which has child beans with cascade deletion configured or instead when I try to remove children myself inside parent bean's ejbRemove() method. Stack trace top is: javax.ejb.TransactionRolledbackLocalException: removing bean lock and it has tx set!; CausedByException is: removing bean lock and it has tx set! at org.jboss.ejb.plugins.AbstractTxInterceptor.invokeNext(AbstractTxInterceptor.java:224) at org.jboss.ejb.plugins.TxInterceptorCMT.runWithTransactions(TxInterceptorCMT.java:232) at org.jboss.ejb.plugins.TxInterceptorCMT.invoke(TxInterceptorCMT.java:60) at org.jboss.ejb.plugins.SecurityInterceptor.invoke(SecurityInterceptor.java:130) at org.jboss.ejb.plugins.LogInterceptor.invoke(LogInterceptor.java:203) at org.jboss.ejb.EntityContainer.invoke(EntityContainer.java:493) at org.jboss.ejb.plugins.cmp.jdbc.bridge.JDBCCMRFieldBridge.invokeRemoveRelation(JDBCCMRFieldBridge.java:700) at org.jboss.ejb.plugins.cmp.jdbc.bridge.JDBCCMRFieldBridge.destroyRelationLinks(JDBCCMRFieldBridge.java:616) at org.jboss.ejb.plugins.cmp.jdbc.bridge.JDBCCMRFieldBridge.destroyRelationLinks(JDBCCMRFieldBridge.java:594) at org.jboss.ejb.plugins.cmp.jdbc.bridge.JDBCCMRFieldBridge.setInstanceValue(JDBCCMRFieldBridge.java:528) at org.jboss.ejb.plugins.cmp.jdbc.JDBCRemoveEntityCommand.removeFromRelations(JDBCRemoveEntityCommand.java:140) at org.jboss.ejb.plugins.cmp.jdbc.JDBCRemoveEntityCommand.execute(JDBCRemoveEntityCommand.java:70) at org.jboss.ejb.plugins.cmp.jdbc.JDBCStoreManager.removeEntity(JDBCStoreManager.java:635) at org.jboss.ejb.plugins.CMPPersistenceManager.removeEntity(CMPPersistenceManager.java:542) at org.jboss.resource.connectionmanager.CachedConnectionInterceptor.removeEntity(CachedConnectionInterceptor.java:431) at org.jboss.ejb.EntityContainer.remove(EntityContainer.java:506) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25) at java.lang.reflect.Method.invoke(Method.java:324) at org.jboss.ejb.EntityContainer$ContainerInterceptor.invoke(EntityContainer.java:1170) at org.jboss.ejb.plugins.cmp.jdbc.JDBCRelationInterceptor.invoke(JDBCRelationInterceptor.java:95) at org.jboss.ejb.plugins.EntitySynchronizationInterceptor.invoke(EntitySynchronizationInterceptor.java:308) at org.jboss.resource.connectionmanager.CachedConnectionInterceptor.invoke(CachedConnectionInterceptor.java:186) at org.jboss.ejb.plugins.EntityInstanceInterceptor.invoke(EntityInstanceInterceptor.java:152) at org.jboss.ejb.plugins.EntityLockInterceptor.invoke(EntityLockInterceptor.java:107) at org.jboss.ejb.plugins.EntityCreationInterceptor.invoke(EntityCreationInterceptor.java:69) at org.jboss.ejb.plugins.AbstractTxInterceptor.invokeNext(AbstractTxInterceptor.java:107) at org.jboss.ejb.plugins.TxInterceptorCMT.runWithTransactions(TxInterceptorCMT.java:178) at org.jboss.ejb.plugins.TxInterceptorCMT.invoke(TxInterceptorCMT.java:60) at org.jboss.ejb.plugins.SecurityInterceptor.invoke(SecurityInterceptor.java:130) at org.jboss.ejb.plugins.LogInterceptor.invoke(LogInterceptor.java:203) at org.jboss.ejb.EntityContainer.invoke(EntityContainer.java:493) at org.jboss.ejb.plugins.local.BaseLocalContainerInvoker.invoke(BaseLocalContainerInvoker.java:301) at org.jboss.ejb.plugins.local.EntityProxy.invoke(EntityProxy.java:38) at $Proxy1214.remove(Unknown Source) at com.tw.mms.ejb.SMILBean.ejbRemove(SMILBean.java:34) [...] ---------------------------------------------------------------------- Comment By: Alexei Yudichev (sflexus) Date: 2002-09-12 10:52 Message: Logged In: YES user_id=345880 I use 3.0.2 and for me it happens every time I remove cmp20 bean which has child beans with cascade deletion configured or instead when I try to remove children myself inside parent bean's ejbRemove() method. Stack trace top is: javax.ejb.TransactionRolledbackLocalException: removing bean lock and it has tx set!; CausedByException is: removing bean lock and it has tx set! at org.jboss.ejb.plugins.AbstractTxInterceptor.invokeNext(AbstractTxInterceptor.java:224) at org.jboss.ejb.plugins.TxInterceptorCMT.runWithTransactions(TxInterceptorCMT.java:232) at org.jboss.ejb.plugins.TxInterceptorCMT.invoke(TxInterceptorCMT.java:60) at org.jboss.ejb.plugins.SecurityInterceptor.invoke(SecurityInterceptor.java:130) at org.jboss.ejb.plugins.LogInterceptor.invoke(LogInterceptor.java:203) at org.jboss.ejb.EntityContainer.invoke(EntityContainer.java:493) at org.jboss.ejb.plugins.cmp.jdbc.bridge.JDBCCMRFieldBridge.invokeRemoveRelation(JDBCCMRFieldBridge.java:700) at org.jboss.ejb.plugins.cmp.jdbc.bridge.JDBCCMRFieldBridge.destroyRelationLinks(JDBCCMRFieldBridge.java:616) at org.jboss.ejb.plugins.cmp.jdbc.bridge.JDBCCMRFieldBridge.destroyRelationLinks(JDBCCMRFieldBridge.java:594) at org.jboss.ejb.plugins.cmp.jdbc.bridge.JDBCCMRFieldBridge.setInstanceValue(JDBCCMRFieldBridge.java:528) at org.jboss.ejb.plugins.cmp.jdbc.JDBCRemoveEntityCommand.removeFromRelations(JDBCRemoveEntityCommand.java:140) at org.jboss.ejb.plugins.cmp.jdbc.JDBCRemoveEntityCommand.execute(JDBCRemoveEntityCommand.java:70) at org.jboss.ejb.plugins.cmp.jdbc.JDBCStoreManager.removeEntity(JDBCStoreManager.java:635) at org.jboss.ejb.plugins.CMPPersistenceManager.removeEntity(CMPPersistenceManager.java:542) at org.jboss.resource.connectionmanager.CachedConnectionInterceptor.removeEntity(CachedConnectionInterceptor.java:431) at org.jboss.ejb.EntityContainer.remove(EntityContainer.java:506) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25) at java.lang.reflect.Method.invoke(Method.java:324) at org.jboss.ejb.EntityContainer$ContainerInterceptor.invoke(EntityContainer.java:1170) at org.jboss.ejb.plugins.cmp.jdbc.JDBCRelationInterceptor.invoke(JDBCRelationInterceptor.java:95) at org.jboss.ejb.plugins.EntitySynchronizationInterceptor.invoke(EntitySynchronizationInterceptor.java:308) at org.jboss.resource.connectionmanager.CachedConnectionInterceptor.invoke(CachedConnectionInterceptor.java:186) at org.jboss.ejb.plugins.EntityInstanceInterceptor.invoke(EntityInstanceInterceptor.java:152) at org.jboss.ejb.plugins.EntityLockInterceptor.invoke(EntityLockInterceptor.java:107) at org.jboss.ejb.plugins.EntityCreationInterceptor.invoke(EntityCreationInterceptor.java:69) at org.jboss.ejb.plugins.AbstractTxInterceptor.invokeNext(AbstractTxInterceptor.java:107) at org.jboss.ejb.plugins.TxInterceptorCMT.runWithTransactions(TxInterceptorCMT.java:178) at org.jboss.ejb.plugins.TxInterceptorCMT.invoke(TxInterceptorCMT.java:60) at org.jboss.ejb.plugins.SecurityInterceptor.invoke(SecurityInterceptor.java:130) at org.jboss.ejb.plugins.LogInterceptor.invoke(LogInterceptor.java:203) at org.jboss.ejb.EntityContainer.invoke(EntityContainer.java:493) at org.jboss.ejb.plugins.local.BaseLocalContainerInvoker.invoke(BaseLocalContainerInvoker.java:301) at org.jboss.ejb.plugins.local.EntityProxy.invoke(EntityProxy.java:38) at $Proxy1214.remove(Unknown Source) at com.tw.mms.ejb.SMILBean.ejbRemove(SMILBean.java:34) [...] ---------------------------------------------------------------------- Comment By: Alexei Yudichev (sflexus) Date: 2002-09-12 09:26 Message: Logged In: YES user_id=345880 I use 3.0.2 and for me it happens every time I remove cmp20 bean which has child beans with cascade deletion configured or instead when I try to remove children myself inside parent bean's ejbRemove() method. Stack trace top is: javax.ejb.TransactionRolledbackLocalException: removing bean lock and it has tx set!; CausedByException is: removing bean lock and it has tx set! at org.jboss.ejb.plugins.AbstractTxInterceptor.invokeNext(AbstractTxInterceptor.java:224) at org.jboss.ejb.plugins.TxInterceptorCMT.runWithTransactions(TxInterceptorCMT.java:232) at org.jboss.ejb.plugins.TxInterceptorCMT.invoke(TxInterceptorCMT.java:60) at org.jboss.ejb.plugins.SecurityInterceptor.invoke(SecurityInterceptor.java:130) at org.jboss.ejb.plugins.LogInterceptor.invoke(LogInterceptor.java:203) at org.jboss.ejb.EntityContainer.invoke(EntityContainer.java:493) at org.jboss.ejb.plugins.cmp.jdbc.bridge.JDBCCMRFieldBridge.invokeRemoveRelation(JDBCCMRFieldBridge.java:700) at org.jboss.ejb.plugins.cmp.jdbc.bridge.JDBCCMRFieldBridge.destroyRelationLinks(JDBCCMRFieldBridge.java:616) at org.jboss.ejb.plugins.cmp.jdbc.bridge.JDBCCMRFieldBridge.destroyRelationLinks(JDBCCMRFieldBridge.java:594) at org.jboss.ejb.plugins.cmp.jdbc.bridge.JDBCCMRFieldBridge.setInstanceValue(JDBCCMRFieldBridge.java:528) at org.jboss.ejb.plugins.cmp.jdbc.JDBCRemoveEntityCommand.removeFromRelations(JDBCRemoveEntityCommand.java:140) at org.jboss.ejb.plugins.cmp.jdbc.JDBCRemoveEntityCommand.execute(JDBCRemoveEntityCommand.java:70) at org.jboss.ejb.plugins.cmp.jdbc.JDBCStoreManager.removeEntity(JDBCStoreManager.java:635) at org.jboss.ejb.plugins.CMPPersistenceManager.removeEntity(CMPPersistenceManager.java:542) at org.jboss.resource.connectionmanager.CachedConnectionInterceptor.removeEntity(CachedConnectionInterceptor.java:431) at org.jboss.ejb.EntityContainer.remove(EntityContainer.java:506) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25) at java.lang.reflect.Method.invoke(Method.java:324) at org.jboss.ejb.EntityContainer$ContainerInterceptor.invoke(EntityContainer.java:1170) at org.jboss.ejb.plugins.cmp.jdbc.JDBCRelationInterceptor.invoke(JDBCRelationInterceptor.java:95) at org.jboss.ejb.plugins.EntitySynchronizationInterceptor.invoke(EntitySynchronizationInterceptor.java:308) at org.jboss.resource.connectionmanager.CachedConnectionInterceptor.invoke(CachedConnectionInterceptor.java:186) at org.jboss.ejb.plugins.EntityInstanceInterceptor.invoke(EntityInstanceInterceptor.java:152) at org.jboss.ejb.plugins.EntityLockInterceptor.invoke(EntityLockInterceptor.java:107) at org.jboss.ejb.plugins.EntityCreationInterceptor.invoke(EntityCreationInterceptor.java:69) at org.jboss.ejb.plugins.AbstractTxInterceptor.invokeNext(AbstractTxInterceptor.java:107) at org.jboss.ejb.plugins.TxInterceptorCMT.runWithTransactions(TxInterceptorCMT.java:178) at org.jboss.ejb.plugins.TxInterceptorCMT.invoke(TxInterceptorCMT.java:60) at org.jboss.ejb.plugins.SecurityInterceptor.invoke(SecurityInterceptor.java:130) at org.jboss.ejb.plugins.LogInterceptor.invoke(LogInterceptor.java:203) at org.jboss.ejb.EntityContainer.invoke(EntityContainer.java:493) at org.jboss.ejb.plugins.local.BaseLocalContainerInvoker.invoke(BaseLocalContainerInvoker.java:301) at org.jboss.ejb.plugins.local.EntityProxy.invoke(EntityProxy.java:38) at $Proxy1214.remove(Unknown Source) at com.tw.mms.ejb.SMILBean.ejbRemove(SMILBean.java:34) [...] ---------------------------------------------------------------------- Comment By: Panagiotis Korros (pkorros) Date: 2002-07-22 15:25 Message: Logged In: YES user_id=552526 I have the same problem myself. It appears sometimes and calling the EJBLocalHome.remove() method dosn't solve the problem. I have two methods calling the remove method on a session bean. the first calles the remove directly and seems to work fine. the second method loads many beans and calls the remove method to some of them according to an algorythm. the exception i get in JBoss 3.0 final is: java.lang.IllegalStateException: removing bean lock and it has tx set! at org.jboss.ejb.plugins.lock.QueuedPessimisticEJBLock.remov eRef(QueuedPessimisticEJBLock.java:469) at org.jboss.ejb.BeanLockManager.removeLockRef (BeanLockManager.java:78) at org.jboss.ejb.plugins.EntityLockInterceptor.invoke (EntityLockInterceptor.java:124) at org.jboss.ejb.plugins.EntityCreationInterceptor.invoke (EntityCreationInterceptor.java:69) at org.jboss.ejb.plugins.AbstractTxInterceptor.invokeNext (AbstractTxInterceptor.java:96) at org.jboss.ejb.plugins.TxInterceptorCMT.runWithTransactions (TxInterceptorCMT.java:167) at org.jboss.ejb.plugins.TxInterceptorCMT.invoke (TxInterceptorCMT.java:61) at org.jboss.ejb.plugins.SecurityInterceptor.invoke (SecurityInterceptor.java:129) at org.jboss.ejb.plugins.LogInterceptor.invoke (LogInterceptor.java:166) at org.jboss.ejb.EntityContainer.invoke (EntityContainer.java:494) at org.jboss.ejb.plugins.cmp.jdbc.bridge.JDBCCMRFieldBridge.in vokeRemoveRelation(JDBCCMRFieldBridge.java:759) at org.jboss.ejb.plugins.cmp.jdbc.bridge.JDBCCMRFieldBridge.d estroyRelationLinks(JDBCCMRFieldBridge.java:696) at org.jboss.ejb.plugins.cmp.jdbc.bridge.JDBCCMRFieldBridge.d estroyRelationLinks(JDBCCMRFieldBridge.java:674) at org.jboss.ejb.plugins.cmp.jdbc.bridge.JDBCCMRFieldBridge.s etInstanceValue(JDBCCMRFieldBridge.java:608) at org.jboss.ejb.plugins.cmp.jdbc.JDBCRemoveEntityCommand.r emoveFromRelations(JDBCRemoveEntityCommand.java:133) at org.jboss.ejb.plugins.cmp.jdbc.JDBCRemoveEntityCommand. execute(JDBCRemoveEntityCommand.java:67) at org.jboss.ejb.plugins.cmp.jdbc.JDBCStoreManager.removeEnt ity(JDBCStoreManager.java:562) at org.jboss.ejb.plugins.CMPPersistenceManager.removeEntity (CMPPersistenceManager.java:542) at org.jboss.resource.connectionmanager.CachedConnectionInte rceptor.removeEntity(CachedConnectionInterceptor.java:431) at org.jboss.ejb.EntityContainer.remove (EntityContainer.java:507) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke (NativeMethodAccessorImpl.java:39) at sun.reflect.DelegatingMethodAccessorImpl.invoke (DelegatingMethodAccessorImpl.java:25) at java.lang.reflect.Method.invoke(Method.java:324) at org.jboss.ejb.EntityContainer$ContainerInterceptor.invoke (EntityContainer.java:1212) at org.jboss.ejb.plugins.cmp.jdbc.JDBCRelationInterceptor.invok e(JDBCRelationInterceptor.java:190) at org.jboss.ejb.plugins.EntitySynchronizationInterceptor.invoke (EntitySynchronizationInterceptor.java:340) at org.jboss.resource.connectionmanager.CachedConnectionInte rceptor.invoke(CachedConnectionInterceptor.java:186) at org.jboss.ejb.plugins.EntityInstanceInterceptor.invoke (EntityInstanceInterceptor.java:193) at org.jboss.ejb.plugins.EntityLockInterceptor.invoke (EntityLockInterceptor.java:107) at org.jboss.ejb.plugins.EntityCreationInterceptor.invoke (EntityCreationInterceptor.java:69) at org.jboss.ejb.plugins.AbstractTxInterceptor.invokeNext (AbstractTxInterceptor.java:96) at org.jboss.ejb.plugins.TxInterceptorCMT.runWithTransactions (TxInterceptorCMT.java:167) at org.jboss.ejb.plugins.TxInterceptorCMT.invoke (TxInterceptorCMT.java:61) at org.jboss.ejb.plugins.SecurityInterceptor.invoke (SecurityInterceptor.java:129) at org.jboss.ejb.plugins.LogInterceptor.invoke (LogInterceptor.java:166) at org.jboss.ejb.EntityContainer.invoke (EntityContainer.java:494) at org.jboss.ejb.plugins.local.BaseLocalContainerInvoker.invoke (BaseLocalContainerInvoker.java:296) at org.jboss.ejb.plugins.local.LocalHomeProxy.invoke (LocalHomeProxy.java:105) at $Proxy37.remove(Unknown Source) at ecentric.ejb.TreeBean.setShortcutsToNode (TreeBean.java:618) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke (NativeMethodAccessorImpl.java:39) at sun.reflect.DelegatingMethodAccessorImpl.invoke (DelegatingMethodAccessorImpl.java:25) at java.lang.reflect.Method.invoke(Method.java:324) at org.jboss.ejb.StatelessSessionContainer$ContainerInterceptor .invoke(StatelessSessionContainer.java:664) at org.jboss.resource.connectionmanager.CachedConnectionInte rceptor.invoke(CachedConnectionInterceptor.java:186) at org.jboss.ejb.plugins.StatelessSessionInstanceInterceptor.inv oke(StatelessSessionInstanceInterceptor.java:77) at org.jboss.ejb.plugins.AbstractTxInterceptor.invokeNext (AbstractTxInterceptor.java:96) at org.jboss.ejb.plugins.TxInterceptorCMT.runWithTransactions (TxInterceptorCMT.java:167) at org.jboss.ejb.plugins.TxInterceptorCMT.invoke (TxInterceptorCMT.java:61) at org.jboss.ejb.plugins.SecurityInterceptor.invoke (SecurityInterceptor.java:129) at org.jboss.ejb.plugins.LogInterceptor.invoke (LogInterceptor.java:166) at org.jboss.ejb.StatelessSessionContainer.invoke (StatelessSessionContainer.java:313) at org.jboss.ejb.plugins.local.BaseLocalContainerInvoker.invoke (BaseLocalContainerInvoker.java:296) at org.jboss.ejb.plugins.local.StatelessSessionProxy.invoke (StatelessSessionProxy.java:81) at $Proxy46.setShortcutsToNode(Unknown Source) at ecentric.ws.TreeWebService.doGet (TreeWebService.java:172) at javax.servlet.http.HttpServlet.service (HttpServlet.java:740) at javax.servlet.http.HttpServlet.service (HttpServlet.java:853) .... ---------------------------------------------------------------------- You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=376685&aid=582428&group_id=22866 ------------------------------------------------------- This sf.net email is sponsored by:ThinkGeek Welcome to geek heaven. http://thinkgeek.com/sf _______________________________________________ Jboss-development mailing list [EMAIL PROTECTED] https://lists.sourceforge.net/lists/listinfo/jboss-development