alex
Panagiotis Korros wrote:
I have 2 EJBs FolderTypeEJB And FolderEJB
FolderEJB has a 1-many parent-child relationship with itself (cascade-delete is on for this relationship) FolderEJB has a 1-many relationship with FolderTypeEJB (cascade-delete is on for this relationship also)
This ejbs resemble a usual filesystem structure.
Now let's consider the following instance stucture...
FolderEJB (id=65) references FolderEJB (id=67) and they are both of type FolderTypeEJB (id=3)
When I try to remove FolderTypeEJB (id=3) I get the following error:
16:11:16,659 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=67 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:490) 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 $Proxy43.remove(Unknown Source) at org.jboss.ejb.plugins.cmp.jdbc.JDBCRemoveEntityCommand.cascadeDelete(JDB CRemoveEntityCommand.java:340) at org.jboss.ejb.plugins.cmp.jdbc.JDBCRemoveEntityCommand.execute(JDBCRemov eEntityCommand.java:230) at org.jboss.ejb.plugins.cmp.jdbc.JDBCStoreManager.removeEntity(JDBCStoreMa nager.java:694) 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:504) 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) at java.lang.reflect.Method.invoke(Method.java:324) at org.jboss.ejb.EntityContainer$ContainerInterceptor.invoke(EntityContaine r.java:1083) at org.jboss.ejb.plugins.cmp.jdbc.JDBCRelationInterceptor.invoke(JDBCRelati onInterceptor.java:71) at org.jboss.ejb.plugins.EntitySynchronizationInterceptor.invoke(EntitySync hronizationInterceptor.java:298) 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:174) at org.jboss.ejb.plugins.EntityLockInterceptor.invoke(EntityLockInterceptor .java:89) at org.jboss.ejb.plugins.EntityCreationInterceptor.invoke(EntityCreationInt erceptor.java:53) 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:490) 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 $Proxy39.remove(Unknown Source) at orgchart.ejb.OrganizationChartManagerBean.deleteOrganizationalUnitType(O rganizationChartManagerBean.java:618) 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) at java.lang.reflect.Method.invoke(Method.java:324) at org.jboss.ejb.StatelessSessionContainer$ContainerInterceptor.invoke(Stat elessSessionContainer.java:683) at org.jboss.resource.connectionmanager.CachedConnectionInterceptor.invoke( CachedConnectionInterceptor.java:185) at org.jboss.ejb.plugins.StatelessSessionInstanceInterceptor.invoke(Statele ssSessionInstanceInterceptor.java:72) 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.StatelessSessionContainer.internalInvoke(StatelessSessionC ontainer.java:331) 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.StatelessSessionProxy.invoke(StatelessSessio nProxy.java:83) at $Proxy46.deleteFolderType(Unknown Source) at exodus.orgchart.web.actions.SearchFolderTypeAction.deletefolderTypes(Sea rchOrganizationalUnitTypeAction.java:97) at exodus.orgchart.web.actions.SearchFolderTypeAction.execute(SearchOrganiz ationalUnitTypeAction.java:61) at org.apache.struts.action.RequestProcessor.processActionPerform(RequestPr ocessor.java:484) at org.apache.struts.action.RequestProcessor.process(RequestProcessor.java: 274) at org.apache.struts.action.ActionServlet.process(ActionServlet.java:1482) at org.apache.struts.action.ActionServlet.doPost(ActionServlet.java:525) at javax.servlet.http.HttpServlet.service(HttpServlet.java:760) at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
It seems to me that when I call remove() on FolderTypeEJB (id=3), JBossCMP is trying to delete FolderEJB (id=67) twice. The first deletion is caused by FolderTypeEJB (id=3) relation to FolderEJB (id=67) and the second because of the FolderEJB (id=65) relation to FolderEJB (id=67).
I think that JBossCMP should handle this situation and proceed without throwing an exception.
Regards, Panagiotis Korros
------------------------------------------------------- This SF.net email is sponsored by: SF.net Giveback Program. SourceForge.net hosts over 70,000 Open Source Projects. See the people who have HELPED US provide better services: Click here: http://sourceforge.net/supporters.php _______________________________________________ JBoss-user mailing list [EMAIL PROTECTED] https://lists.sourceforge.net/lists/listinfo/jboss-user
------------------------------------------------------- This SF.net email is sponsored by: SF.net Giveback Program. SourceForge.net hosts over 70,000 Open Source Projects. See the people who have HELPED US provide better services: Click here: http://sourceforge.net/supporters.php _______________________________________________ JBoss-user mailing list [EMAIL PROTECTED] https://lists.sourceforge.net/lists/listinfo/jboss-user
