This happens on Jboss 3.2.3 (build: 200311301445) on a Windows 2000 Server machine.
-----Original Message----- From: Panagiotis Korros Sent: Friday, January 16, 2004 12:59 PM To: [EMAIL PROTECTED] Subject: [JBoss-user] CMP: error with cascade delete I get the following error TransactionRolledbackLocalException in method: public abstract void javax.ejb.EJBLocalObject.remove() throws javax.ejb.RemoveException,javax.ejb.EJBException, causedBy: javax.ejb.NoSuchObjectLocalException: Entity not found: primaryKey=84 ... (for complete stack trace go to the end of this message) I have some EJBs to represent a Organization Chart. OrganizationalUnitTypeLocal OrganizationalUnitLocal PositionLocal The relations are: OrganizationalUnit has one OrganizationalUnitType OrganizationalUnit belongs to one or none OrganizationalUnit Position belongs to one OrganizationalUnit All these relations are configured for cascade delete. I create the following instances: OrganizationalUnitTypeLocal/4 OrganizationalUnitLocal/79 (type 4, parent NULL) OrganizationalUnitLocal/80 (type x, parent OrganizatonalUnitLocal/79) OrganizationalUnitLocal/83 (type x, parent OrganizatonalUnitLocal/80) OrganizationalUnitLocal/84 (type 4, parent OrganizatonalUnitLocal/83) OrganizationalUnitLocal/85 (type 4, parent OrganizatonalUnitLocal/83) The problem occures when I try to remove OrganizationalUnitTypeLocal/4. >From the trace I see that jboss correctly deletes all the instances and then tries to load OrganizationalUnitLocal/84 but this is deleted so this exception occures and the transaction is rolled back. 12:25:51,406 DEBUG [OrganizationalUnitType#findByPrimaryKey] Executing SQL: SELECT id FROM tou_type WHERE id=? 12:25:51,421 DEBUG [OrganizationalUnitType] Executing SQL: SELECT name FROM tou_type WHERE (id=?) 12:25:51,421 DEBUG [OrganizationalUnitType] Executing SQL: SELECT id FROM tou WHERE (type=?) 12:25:51,437 DEBUG [OrganizationalUnit] Executing SQL: SELECT id, code, name, imported, status, parent_ou FROM tou WHERE (id=?) OR (id=?) OR (id=?) 12:25:51,437 DEBUG [OrganizationalUnit] Executing SQL: UPDATE tou SET type=? WHERE id=? 12:25:51,453 DEBUG [OrganizationalUnit] Rows affected = 1 12:25:51,453 DEBUG [OrganizationalUnit] Executing SQL: UPDATE tou SET type=? WHERE id=? 12:25:51,453 DEBUG [OrganizationalUnit] Rows affected = 1 12:25:51,453 DEBUG [OrganizationalUnit] Executing SQL: UPDATE tou SET type=? WHERE id=? 12:25:51,453 DEBUG [OrganizationalUnit] Rows affected = 1 12:25:51,453 DEBUG [OrganizationalUnitType] Executing SQL: DELETE FROM tou_type WHERE id=? 12:25:51,453 DEBUG [OrganizationalUnitType] Remove: Rows affected = 1 12:25:51,453 DEBUG [OrganizationalUnitType] Removing ejb/OrganizationalUnitLocal:79 12:25:51,453 DEBUG [OrganizationalUnit] Executing SQL: SELECT belongs_to_ou, id FROM tposition WHERE (belongs_to_ou=?) OR (belongs_to_ou=?) OR (belongs_to_ou=?) 12:25:51,468 DEBUG [OrganizationalUnit] Executing SQL: SELECT parent_ou, id FROM tou WHERE (parent_ou=?) OR (parent_ou=?) OR (parent_ou=?) 12:25:51,500 DEBUG [OrganizationalUnit] Executing SQL: SELECT code, name, imported, status, type FROM tou WHERE (id=?) 12:25:51,500 DEBUG [OrganizationalUnit] Executing SQL: UPDATE tou SET parent_ou=? WHERE id=? 12:25:51,500 DEBUG [OrganizationalUnit] Rows affected = 1 12:25:51,500 DEBUG [OrganizationalUnit] Executing SQL: SELECT id FROM tposition WHERE (belongs_to_ou=?) 12:25:51,515 DEBUG [OrganizationalUnit] Executing SQL: SELECT id FROM tou WHERE (parent_ou=?) 12:25:51,515 DEBUG [OrganizationalUnit] Executing SQL: SELECT code, name, imported, status, type FROM tou WHERE (id=?) 12:25:51,718 DEBUG [OrganizationalUnit] Executing SQL: UPDATE tou SET parent_ou=? WHERE id=? 12:25:51,734 DEBUG [OrganizationalUnit] Rows affected = 1 12:25:51,734 DEBUG [OrganizationalUnit] Executing SQL: SELECT id FROM tposition WHERE (belongs_to_ou=?) 12:25:51,734 DEBUG [OrganizationalUnit] Executing SQL: SELECT id FROM tou WHERE (parent_ou=?) 12:25:51,734 DEBUG [OrganizationalUnit] Executing SQL: UPDATE tou SET parent_ou=? WHERE id=? 12:25:51,750 DEBUG [OrganizationalUnit] Rows affected = 1 12:25:51,750 DEBUG [OrganizationalUnit] Executing SQL: DELETE FROM tou WHERE id=? 12:25:51,750 DEBUG [OrganizationalUnit] Remove: Rows affected = 1 12:25:51,750 DEBUG [OrganizationalUnit] Executing SQL: UPDATE tou SET parent_ou=? WHERE id=? 12:25:51,750 DEBUG [OrganizationalUnit] Rows affected = 1 12:25:51,750 DEBUG [OrganizationalUnit] Executing SQL: DELETE FROM tou WHERE id=? 12:25:51,750 DEBUG [OrganizationalUnit] Remove: Rows affected = 1 12:25:51,750 DEBUG [OrganizationalUnitType] Executing SQL: SELECT name FROM tou_type WHERE (id=?) 12:25:51,765 DEBUG [OrganizationalUnit] Executing SQL: DELETE FROM tou WHERE id=? 12:25:51,781 DEBUG [OrganizationalUnit] Remove: Rows affected = 1 12:25:51,781 DEBUG [OrganizationalUnit] Executing SQL: DELETE FROM tou WHERE id=? 12:25:51,781 DEBUG [OrganizationalUnit] Remove: Rows affected = 1 12:25:51,781 DEBUG [OrganizationalUnit] Executing SQL: DELETE FROM tou WHERE id=? 12:25:51,781 DEBUG [OrganizationalUnit] Remove: Rows affected = 1 12:25:51,781 DEBUG [OrganizationalUnitType] Removing ejb/OrganizationalUnitLocal:84 12:25:51,781 DEBUG [OrganizationalUnit] Executing SQL: SELECT code, name, imported, status, parent_ou, type FROM tou WHERE (id=?) 12:25:51,796 ERROR [LogInterceptor] TransactionRolledbackLocalException in method: public abstract void javax.ejb.EJBLocalObject.remove() throws javax.ejb.RemoveException,javax.ejb.EJBException, causedBy: javax.ejb.NoSuchObjectLocalException: Entity not found: primaryKey=84 at org.jboss.ejb.plugins.AbstractTxInterceptor.invokeNext(AbstractTxInterce ptor.java:158) at org.jboss.ejb.plugins.TxInterceptorCMT.runWithTransactions(TxInterceptor CMT.java:267) at org.jboss.ejb.plugins.TxInterceptorCMT.invoke(TxInterceptorCMT.java:128) at org.jboss.ejb.plugins.SecurityInterceptor.invoke(SecurityInterceptor.jav a:118) at org.jboss.ejb.plugins.LogInterceptor.invoke(LogInterceptor.java:191) at org.jboss.ejb.plugins.ProxyFactoryFinderInterceptor.invoke(ProxyFactoryF inderInterceptor.java:122) at org.jboss.ejb.EntityContainer.internalInvoke(EntityContainer.java:489) at org.jboss.ejb.Container.invoke(Container.java:700) at org.jboss.ejb.plugins.local.BaseLocalProxyFactory.invoke(BaseLocalProxyF actory.java:375) at org.jboss.ejb.plugins.local.EntityProxy.invoke(EntityProxy.java:38) at $Proxy49.remove(Unknown Source) at org.jboss.ejb.plugins.cmp.jdbc.CascadeDeleteStrategy$DefaultCascadeDelet eStrategy.cascadeDelete(CascadeDeleteStrategy.java:141) at org.jboss.ejb.plugins.cmp.jdbc.bridge.JDBCCMRFieldBridge.cascadeDelete(J DBCCMRFieldBridge.java:318) at org.jboss.ejb.plugins.cmp.jdbc.bridge.JDBCEntityBridge.cascadeDelete(JDB CEntityBridge.java:326) at org.jboss.ejb.plugins.cmp.jdbc.JDBCRemoveEntityCommand.execute(JDBCRemov eEntityCommand.java:115) at org.jboss.ejb.plugins.cmp.jdbc.JDBCStoreManager.removeEntity(JDBCStoreMa nager.java:667) at org.jboss.ejb.plugins.CMPPersistenceManager.removeEntity(CMPPersistenceM anager.java:492) at org.jboss.resource.connectionmanager.CachedConnectionInterceptor.removeE ntity(CachedConnectionInterceptor.java:430) at org.jboss.ejb.EntityContainer.remove(EntityContainer.java:505) at sun.reflect.GeneratedMethodAccessor175.invoke(Unknown Source) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessor Impl.java:25) at java.lang.reflect.Method.invoke(Method.java:324) at org.jboss.ejb.EntityContainer$ContainerInterceptor.invoke(EntityContaine r.java:1084) at org.jboss.ejb.plugins.cmp.jdbc.JDBCRelationInterceptor.invoke(JDBCRelati onInterceptor.java:72) at org.jboss.ejb.plugins.EntitySynchronizationInterceptor.invoke(EntitySync hronizationInterceptor.java:282) at org.jboss.resource.connectionmanager.CachedConnectionInterceptor.invoke( CachedConnectionInterceptor.java:185) at org.jboss.ejb.plugins.EntityReentranceInterceptor.invoke(EntityReentranc eInterceptor.java:114) at org.jboss.ejb.plugins.EntityInstanceInterceptor.invoke(EntityInstanceInt erceptor.java:163) at org.jboss.ejb.plugins.EntityLockInterceptor.invoke(EntityLockInterceptor .java:89) at org.jboss.ejb.plugins.EntityCreationInterceptor.invoke(EntityCreationInt erceptor.java:54) at org.jboss.ejb.plugins.AbstractTxInterceptor.invokeNext(AbstractTxInterce ptor.java:84) at org.jboss.ejb.plugins.TxInterceptorCMT.runWithTransactions(TxInterceptor CMT.java:267) at org.jboss.ejb.plugins.TxInterceptorCMT.invoke(TxInterceptorCMT.java:128) at org.jboss.ejb.plugins.SecurityInterceptor.invoke(SecurityInterceptor.jav a:118) at org.jboss.ejb.plugins.LogInterceptor.invoke(LogInterceptor.java:191) at org.jboss.ejb.plugins.ProxyFactoryFinderInterceptor.invoke(ProxyFactoryF inderInterceptor.java:122) at org.jboss.ejb.EntityContainer.internalInvoke(EntityContainer.java:489) at org.jboss.ejb.Container.invoke(Container.java:700) at org.jboss.ejb.plugins.local.BaseLocalProxyFactory.invoke(BaseLocalProxyF actory.java:375) at org.jboss.ejb.plugins.local.EntityProxy.invoke(EntityProxy.java:38) at $Proxy50.remove(Unknown Source) at orgchart.ejb.OrganizationChartManagerBean.deleteOrganizationalUnitType(O rganizationChartManagerBean.java:684) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.jav a:39) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessor Impl.java:25) ... ------------------------------------------------------- The SF.Net email is sponsored by EclipseCon 2004 Premiere Conference on Open Tools Development and Integration See the breadth of Eclipse activity. February 3-5 in Anaheim, CA. http://www.eclipsecon.org/osdn _______________________________________________ JBoss-user mailing list [EMAIL PROTECTED] https://lists.sourceforge.net/lists/listinfo/jboss-user ------------------------------------------------------- The SF.Net email is sponsored by EclipseCon 2004 Premiere Conference on Open Tools Development and Integration See the breadth of Eclipse activity. February 3-5 in Anaheim, CA. http://www.eclipsecon.org/osdn _______________________________________________ JBoss-user mailing list [EMAIL PROTECTED] https://lists.sourceforge.net/lists/listinfo/jboss-user