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-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

Reply via email to