Trails
  1. Trails
  2. TRAILS-19

foreign references being deleted

    Details

    • Type: Bug Bug
    • Status: Closed Closed
    • Priority: Critical Critical
    • Resolution: Fixed
    • Affects Version/s: None
    • Fix Version/s: 1.0.0
    • Component/s: None
    • Labels:
      None
    • Environment:
      XP Pro, jetty-6.x, eclipse-3.2.1
    • Number of attachments :
      0

      Description

      Organization.JAVA
      private Set<Coach> coaches = new HashSet<Coach>();
      @OneToMany(cascade = CascadeType.ALL, fetch = FetchType.EAGER)
      @JoinColumn(name = "organization_id", insertable = true, updatable = true, nullable = true)
      @Collection(child = true)
      @PropertyDescriptor(readOnly = false)
      @OrderBy("lastName")
      public Set<Coach> getCoaches()

      { return coaches; }

      Coach.JAVA
      private Organization organization;
      @ManyToOne(cascade = CascadeType.ALL, fetch = FetchType.EAGER)
      @JoinColumn(name = "organization_id", insertable = true, updatable = true, nullable = true)
      public Organization getOrganization()

      { return organization; }

      Above is a bidirectional mapping.

      1. create organization
      2. create coach from within organization editor (ADD NEW)
      3. save everything
      4. edit coach from within organization editor
      5. DELETE

      Everythign gets deleted + exceptions to boot. Shouldn't only the coach get deleted and not the container?

      See below:

      Hibernate: delete from Coach where id=?
      Hibernate: delete from UploadableMedia where id=?
      Hibernate: delete from Organization where id=?
      Hibernate: delete from UploadableMedia where id=?
      Hibernate: delete from UploadableMedia where id=?
      Hibernate: delete from UploadableMedia where id=?
      Hibernate: select this_.id as id5_0_, this_.name as name5_0_, this_.state as state5_0_, this_.header_id as header7_5_0_, this_.created as created5_0_, this_.accessed as accessed5_0_, this_.photo_id as photo8_5_0_, this_.city as city5_0_, this_.director_id as director9_5_0_, this_.logo_id as logo10_5_0_ from Organization this_ where this_.name=? and not (this_.id = ?)
      Hibernate: update Organization set name=?, state=?, header_id=?, created=?, accessed=?, photo_id=?, city=?, director_id=?, logo_id=? where id=?
      2007-01-30 17:12:26,718 [btpool0-3] ERROR org.hibernate.jdbc.AbstractBatcher - Exception executing batch:
      org.hibernate.StaleStateException: Batch update returned unexpected row count from update: 0 actual row count: 0 expected: 1
      at org.hibernate.jdbc.BatchingBatcher.checkRowCount(BatchingBatcher.java:93)
      at org.hibernate.jdbc.BatchingBatcher.checkRowCounts(BatchingBatcher.java:79)
      at org.hibernate.jdbc.BatchingBatcher.doExecuteBatch(BatchingBatcher.java:58)
      at org.hibernate.jdbc.AbstractBatcher.executeBatch(AbstractBatcher.java:195)
      at org.hibernate.jdbc.AbstractBatcher.prepareStatement(AbstractBatcher.java:91)
      at org.hibernate.jdbc.AbstractBatcher.prepareStatement(AbstractBatcher.java:86)
      at org.hibernate.jdbc.AbstractBatcher.prepareBatchStatement(AbstractBatcher.java:171)
      at org.hibernate.persister.entity.AbstractEntityPersister.update(AbstractEntityPersister.java:2163)
      at org.hibernate.persister.entity.AbstractEntityPersister.updateOrInsert(AbstractEntityPersister.java:2118)
      at org.hibernate.persister.entity.AbstractEntityPersister.update(AbstractEntityPersister.java:2374)
      at org.hibernate.action.EntityUpdateAction.execute(EntityUpdateAction.java:91)
      at org.hibernate.engine.ActionQueue.execute(ActionQueue.java:248)
      at org.hibernate.engine.ActionQueue.executeActions(ActionQueue.java:232)
      at org.hibernate.engine.ActionQueue.executeActions(ActionQueue.java:140)
      at org.hibernate.event.def.AbstractFlushingEventListener.performExecutions(AbstractFlushingEventListener.java:297)
      at org.hibernate.event.def.DefaultFlushEventListener.onFlush(DefaultFlushEventListener.java:27)
      at org.hibernate.impl.SessionImpl.flush(SessionImpl.java:985)
      at org.hibernate.impl.SessionImpl.managedFlush(SessionImpl.java:333)
      at org.hibernate.transaction.JDBCTransaction.commit(JDBCTransaction.java:106)
      at org.springframework.orm.hibernate3.HibernateTransactionManager.doCommit(HibernateTransactionManager.java:558)
      at org.springframework.transaction.support.AbstractPlatformTransactionManager.processCommit(AbstractPlatformTransactionManager.java:540)
      at org.springframework.transaction.support.AbstractPlatformTransactionManager.commit(AbstractPlatformTransactionManager.java:510)
      at org.springframework.transaction.interceptor.TransactionAspectSupport.commitTransactionAfterReturning(TransactionAspectSupport.java:310)
      at org.springframework.transaction.interceptor.TransactionInterceptor.invoke(TransactionInterceptor.java:117)
      at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:185)
      at org.springframework.aop.framework.JdkDynamicAopProxy.invoke(JdkDynamicAopProxy.java:209)
      at $Proxy34.save(Unknown Source)
      at org.trails.callback.CollectionCallback.remove(CollectionCallback.java:60)
      at org.trails.page.EditPage.remove(EditPage.java:104)
      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:585)
      at org.apache.tapestry.listener.ListenerMethodInvokerImpl.invokeTargetMethod(ListenerMethodInvokerImpl.java:214)
      at org.apache.tapestry.listener.ListenerMethodInvokerImpl.invokeListenerMethod(ListenerMethodInvokerImpl.java:155)
      at org.apache.tapestry.listener.ListenerMethodInvokerImpl.searchAndInvoke(ListenerMethodInvokerImpl.java:124)
      at org.apache.tapestry.listener.ListenerMethodInvokerImpl.invokeListenerMethod(ListenerMethodInvokerImpl.java:69)
      at org.apache.tapestry.listener.SyntheticListener.actionTriggered(SyntheticListener.java:51)
      at org.apache.tapestry.listener.ListenerInvokerTerminator.invokeListener(ListenerInvokerTerminator.java:51)
      at $ListenerInvoker_110750b1cf9.invokeListener($ListenerInvoker_110750b1cf9.java)
      at org.apache.tapestry.form.AbstractSubmit.handleClick(AbstractSubmit.java:81)
      at org.apache.tapestry.form.AbstractSubmit.rewindFormComponent(AbstractSubmit.java:49)
      at org.apache.tapestry.form.AbstractFormComponent.renderComponent(AbstractFormComponent.java:114)
      at org.apache.tapestry.AbstractComponent.render(AbstractComponent.java:617)
      at org.apache.tapestry.AbstractComponent.renderBody(AbstractComponent.java:434)
      at org.apache.tapestry.components.IfBean.renderComponent(IfBean.java:86)
      at $IfBean_7.renderComponent($IfBean_7.java)
      at org.apache.tapestry.AbstractComponent.render(AbstractComponent.java:617)
      at org.apache.tapestry.AbstractComponent.renderBody(AbstractComponent.java:434)
      at org.apache.tapestry.components.Any.renderComponent(Any.java:48)
      at $Any_21.renderComponent($Any_21.java)
      at org.apache.tapestry.AbstractComponent.render(AbstractComponent.java:617)
      at org.apache.tapestry.BaseComponent.renderComponent(BaseComponent.java:92)
      at org.apache.tapestry.AbstractComponent.render(AbstractComponent.java:617)
      at org.apache.tapestry.AbstractComponent.renderBody(AbstractComponent.java:434)
      at org.apache.tapestry.form.FormSupportImpl.rewind(FormSupportImpl.java:573)
      at org.apache.tapestry.form.Form.renderComponent(Form.java:226)
      at $Form_40.renderComponent($Form_40.java)
      at org.apache.tapestry.AbstractComponent.render(AbstractComponent.java:617)
      at org.apache.tapestry.form.Form.rewind(Form.java:327)
      at org.apache.tapestry.engine.RequestCycle.rewindForm(RequestCycle.java:439)
      at org.apache.tapestry.form.Form.trigger(Form.java:338)
      at org.apache.tapestry.engine.DirectService.triggerComponent(DirectService.java:146)
      at org.apache.tapestry.engine.DirectService.service(DirectService.java:132)
      at $IEngineService_110750b1d5b.service($IEngineService_110750b1d5b.java)
      at org.apache.tapestry.services.impl.EngineServiceOuterProxy.service(EngineServiceOuterProxy.java:66)
      at org.apache.tapestry.engine.AbstractEngine.service(AbstractEngine.java:248)
      at org.apache.tapestry.services.impl.InvokeEngineTerminator.service(InvokeEngineTerminator.java:60)
      at $WebRequestServicer_110750b1d2d.service($WebRequestServicer_110750b1d2d.java)
      at com.javaforge.tapestry.tapernate.filter.TapernateFilter.service(TapernateFilter.java:81)
      at $WebRequestServicerFilter_110750b1d2b.service($WebRequestServicerFilter_110750b1d2b.java)
      at $WebRequestServicer_110750b1d2f.service($WebRequestServicer_110750b1d2f.java)
      at $WebRequestServicer_110750b1d27.service($WebRequestServicer_110750b1d27.java)
      at org.apache.tapestry.services.impl.WebRequestServicerPipelineBridge.service(WebRequestServicerPipelineBridge.java:56)
      at $ServletRequestServicer_110750b1d0d.service($ServletRequestServicer_110750b1d0d.java)
      at org.apache.tapestry.request.DecodedRequestInjector.service(DecodedRequestInjector.java:55)
      at $ServletRequestServicerFilter_110750b1d09.service($ServletRequestServicerFilter_110750b1d09.java)
      at $ServletRequestServicer_110750b1d0f.service($ServletRequestServicer_110750b1d0f.java)
      at org.apache.tapestry.multipart.MultipartDecoderFilter.service(MultipartDecoderFilter.java:52)
      at $ServletRequestServicerFilter_110750b1d07.service($ServletRequestServicerFilter_110750b1d07.java)
      at $ServletRequestServicer_110750b1d0f.service($ServletRequestServicer_110750b1d0f.java)
      at org.apache.tapestry.services.impl.SetupRequestEncoding.service(SetupRequestEncoding.java:53)
      at $ServletRequestServicerFilter_110750b1d0b.service($ServletRequestServicerFilter_110750b1d0b.java)
      at $ServletRequestServicer_110750b1d0f.service($ServletRequestServicer_110750b1d0f.java)
      at $ServletRequestServicer_110750b1d01.service($ServletRequestServicer_110750b1d01.java)
      at org.apache.tapestry.ApplicationServlet.doService(ApplicationServlet.java:123)
      at org.apache.tapestry.ApplicationServlet.doPost(ApplicationServlet.java:168)
      at javax.servlet.http.HttpServlet.service(HttpServlet.java:615)
      at javax.servlet.http.HttpServlet.service(HttpServlet.java:688)
      at org.mortbay.jetty.servlet.ServletHolder.handle(ServletHolder.java:491)
      at org.mortbay.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1074)
      at org.springframework.orm.hibernate3.support.OpenSessionInViewFilter.doFilterInternal(OpenSessionInViewFilter.java:174)
      at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:77)
      at org.mortbay.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1065)
      at org.mortbay.jetty.servlet.ServletHandler.handle(ServletHandler.java:365)
      at org.mortbay.jetty.security.SecurityHandler.handle(SecurityHandler.java:185)
      at org.mortbay.jetty.servlet.SessionHandler.handle(SessionHandler.java:181)
      at org.mortbay.jetty.handler.ContextHandler.handle(ContextHandler.java:690)
      at org.mortbay.jetty.webapp.WebAppContext.handle(WebAppContext.java:401)
      at org.mortbay.jetty.handler.ContextHandlerCollection.handle(ContextHandlerCollection.java:146)
      at org.mortbay.jetty.handler.HandlerCollection.handle(HandlerCollection.java:114)
      at org.mortbay.jetty.handler.HandlerWrapper.handle(HandlerWrapper.java:139)
      at org.mortbay.jetty.Server.handle(Server.java:285)
      at org.mortbay.jetty.HttpConnection.handleRequest(HttpConnection.java:457)
      at org.mortbay.jetty.HttpConnection$RequestHandler.content(HttpConnection.java:765)
      at org.mortbay.jetty.HttpParser.parseNext(HttpParser.java:628)
      at org.mortbay.jetty.HttpParser.parseAvailable(HttpParser.java:203)
      at org.mortbay.jetty.HttpConnection.handle(HttpConnection.java:357)
      at org.mortbay.io.nio.SelectChannelEndPoint.run(SelectChannelEndPoint.java:329)
      at org.mortbay.thread.BoundedThreadPool$PoolThread.run(BoundedThreadPool.java:475)
      2007-01-30 17:12:26,734 [btpool0-3] ERROR org.hibernate.event.def.AbstractFlushingEventListener - Could not synchronize database state with session
      org.hibernate.StaleStateException: Batch update returned unexpected row count from update: 0 actual row count: 0 expected: 1
      at org.hibernate.jdbc.BatchingBatcher.checkRowCount(BatchingBatcher.java:93)
      at org.hibernate.jdbc.BatchingBatcher.checkRowCounts(BatchingBatcher.java:79)
      at org.hibernate.jdbc.BatchingBatcher.doExecuteBatch(BatchingBatcher.java:58)
      at org.hibernate.jdbc.AbstractBatcher.executeBatch(AbstractBatcher.java:195)
      at org.hibernate.jdbc.AbstractBatcher.prepareStatement(AbstractBatcher.java:91)
      at org.hibernate.jdbc.AbstractBatcher.prepareStatement(AbstractBatcher.java:86)
      at org.hibernate.jdbc.AbstractBatcher.prepareBatchStatement(AbstractBatcher.java:171)
      at org.hibernate.persister.entity.AbstractEntityPersister.update(AbstractEntityPersister.java:2163)
      at org.hibernate.persister.entity.AbstractEntityPersister.updateOrInsert(AbstractEntityPersister.java:2118)
      at org.hibernate.persister.entity.AbstractEntityPersister.update(AbstractEntityPersister.java:2374)
      at org.hibernate.action.EntityUpdateAction.execute(EntityUpdateAction.java:91)
      at org.hibernate.engine.ActionQueue.execute(ActionQueue.java:248)
      at org.hibernate.engine.ActionQueue.executeActions(ActionQueue.java:232)
      at org.hibernate.engine.ActionQueue.executeActions(ActionQueue.java:140)
      at org.hibernate.event.def.AbstractFlushingEventListener.performExecutions(AbstractFlushingEventListener.java:297)
      at org.hibernate.event.def.DefaultFlushEventListener.onFlush(DefaultFlushEventListener.java:27)
      at org.hibernate.impl.SessionImpl.flush(SessionImpl.java:985)
      at org.hibernate.impl.SessionImpl.managedFlush(SessionImpl.java:333)
      at org.hibernate.transaction.JDBCTransaction.commit(JDBCTransaction.java:106)
      at org.springframework.orm.hibernate3.HibernateTransactionManager.doCommit(HibernateTransactionManager.java:558)
      at org.springframework.transaction.support.AbstractPlatformTransactionManager.processCommit(AbstractPlatformTransactionManager.java:540)
      at org.springframework.transaction.support.AbstractPlatformTransactionManager.commit(AbstractPlatformTransactionManager.java:510)
      at org.springframework.transaction.interceptor.TransactionAspectSupport.commitTransactionAfterReturning(TransactionAspectSupport.java:310)
      at org.springframework.transaction.interceptor.TransactionInterceptor.invoke(TransactionInterceptor.java:117)
      at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:185)
      at org.springframework.aop.framework.JdkDynamicAopProxy.invoke(JdkDynamicAopProxy.java:209)
      at $Proxy34.save(Unknown Source)
      at org.trails.callback.CollectionCallback.remove(CollectionCallback.java:60)
      at org.trails.page.EditPage.remove(EditPage.java:104)
      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:585)
      at org.apache.tapestry.listener.ListenerMethodInvokerImpl.invokeTargetMethod(ListenerMethodInvokerImpl.java:214)
      at org.apache.tapestry.listener.ListenerMethodInvokerImpl.invokeListenerMethod(ListenerMethodInvokerImpl.java:155)
      at org.apache.tapestry.listener.ListenerMethodInvokerImpl.searchAndInvoke(ListenerMethodInvokerImpl.java:124)
      at org.apache.tapestry.listener.ListenerMethodInvokerImpl.invokeListenerMethod(ListenerMethodInvokerImpl.java:69)
      at org.apache.tapestry.listener.SyntheticListener.actionTriggered(SyntheticListener.java:51)
      at org.apache.tapestry.listener.ListenerInvokerTerminator.invokeListener(ListenerInvokerTerminator.java:51)
      at $ListenerInvoker_110750b1cf9.invokeListener($ListenerInvoker_110750b1cf9.java)
      at org.apache.tapestry.form.AbstractSubmit.handleClick(AbstractSubmit.java:81)
      at org.apache.tapestry.form.AbstractSubmit.rewindFormComponent(AbstractSubmit.java:49)
      at org.apache.tapestry.form.AbstractFormComponent.renderComponent(AbstractFormComponent.java:114)
      at org.apache.tapestry.AbstractComponent.render(AbstractComponent.java:617)
      at org.apache.tapestry.AbstractComponent.renderBody(AbstractComponent.java:434)
      at org.apache.tapestry.components.IfBean.renderComponent(IfBean.java:86)
      at $IfBean_7.renderComponent($IfBean_7.java)
      at org.apache.tapestry.AbstractComponent.render(AbstractComponent.java:617)
      at org.apache.tapestry.AbstractComponent.renderBody(AbstractComponent.java:434)
      at org.apache.tapestry.components.Any.renderComponent(Any.java:48)
      at $Any_21.renderComponent($Any_21.java)
      at org.apache.tapestry.AbstractComponent.render(AbstractComponent.java:617)
      at org.apache.tapestry.BaseComponent.renderComponent(BaseComponent.java:92)
      at org.apache.tapestry.AbstractComponent.render(AbstractComponent.java:617)
      at org.apache.tapestry.AbstractComponent.renderBody(AbstractComponent.java:434)
      at org.apache.tapestry.form.FormSupportImpl.rewind(FormSupportImpl.java:573)
      at org.apache.tapestry.form.Form.renderComponent(Form.java:226)
      at $Form_40.renderComponent($Form_40.java)
      at org.apache.tapestry.AbstractComponent.render(AbstractComponent.java:617)
      at org.apache.tapestry.form.Form.rewind(Form.java:327)
      at org.apache.tapestry.engine.RequestCycle.rewindForm(RequestCycle.java:439)
      at org.apache.tapestry.form.Form.trigger(Form.java:338)
      at org.apache.tapestry.engine.DirectService.triggerComponent(DirectService.java:146)
      at org.apache.tapestry.engine.DirectService.service(DirectService.java:132)
      at $IEngineService_110750b1d5b.service($IEngineService_110750b1d5b.java)
      at org.apache.tapestry.services.impl.EngineServiceOuterProxy.service(EngineServiceOuterProxy.java:66)
      at org.apache.tapestry.engine.AbstractEngine.service(AbstractEngine.java:248)
      at org.apache.tapestry.services.impl.InvokeEngineTerminator.service(InvokeEngineTerminator.java:60)
      at $WebRequestServicer_110750b1d2d.service($WebRequestServicer_110750b1d2d.java)
      at com.javaforge.tapestry.tapernate.filter.TapernateFilter.service(TapernateFilter.java:81)
      at $WebRequestServicerFilter_110750b1d2b.service($WebRequestServicerFilter_110750b1d2b.java)
      at $WebRequestServicer_110750b1d2f.service($WebRequestServicer_110750b1d2f.java)
      at $WebRequestServicer_110750b1d27.service($WebRequestServicer_110750b1d27.java)
      at org.apache.tapestry.services.impl.WebRequestServicerPipelineBridge.service(WebRequestServicerPipelineBridge.java:56)
      at $ServletRequestServicer_110750b1d0d.service($ServletRequestServicer_110750b1d0d.java)
      at org.apache.tapestry.request.DecodedRequestInjector.service(DecodedRequestInjector.java:55)
      at $ServletRequestServicerFilter_110750b1d09.service($ServletRequestServicerFilter_110750b1d09.java)
      at $ServletRequestServicer_110750b1d0f.service($ServletRequestServicer_110750b1d0f.java)
      at org.apache.tapestry.multipart.MultipartDecoderFilter.service(MultipartDecoderFilter.java:52)
      at $ServletRequestServicerFilter_110750b1d07.service($ServletRequestServicerFilter_110750b1d07.java)
      at $ServletRequestServicer_110750b1d0f.service($ServletRequestServicer_110750b1d0f.java)
      at org.apache.tapestry.services.impl.SetupRequestEncoding.service(SetupRequestEncoding.java:53)
      at $ServletRequestServicerFilter_110750b1d0b.service($ServletRequestServicerFilter_110750b1d0b.java)
      at $ServletRequestServicer_110750b1d0f.service($ServletRequestServicer_110750b1d0f.java)
      at $ServletRequestServicer_110750b1d01.service($ServletRequestServicer_110750b1d01.java)
      at org.apache.tapestry.ApplicationServlet.doService(ApplicationServlet.java:123)
      at org.apache.tapestry.ApplicationServlet.doPost(ApplicationServlet.java:168)
      at javax.servlet.http.HttpServlet.service(HttpServlet.java:615)
      at javax.servlet.http.HttpServlet.service(HttpServlet.java:688)
      at org.mortbay.jetty.servlet.ServletHolder.handle(ServletHolder.java:491)
      at org.mortbay.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1074)
      at org.springframework.orm.hibernate3.support.OpenSessionInViewFilter.doFilterInternal(OpenSessionInViewFilter.java:174)
      at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:77)
      at org.mortbay.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1065)
      at org.mortbay.jetty.servlet.ServletHandler.handle(ServletHandler.java:365)
      at org.mortbay.jetty.security.SecurityHandler.handle(SecurityHandler.java:185)
      at org.mortbay.jetty.servlet.SessionHandler.handle(SessionHandler.java:181)
      at org.mortbay.jetty.handler.ContextHandler.handle(ContextHandler.java:690)
      at org.mortbay.jetty.webapp.WebAppContext.handle(WebAppContext.java:401)
      at org.mortbay.jetty.handler.ContextHandlerCollection.handle(ContextHandlerCollection.java:146)
      at org.mortbay.jetty.handler.HandlerCollection.handle(HandlerCollection.java:114)
      at org.mortbay.jetty.handler.HandlerWrapper.handle(HandlerWrapper.java:139)
      at org.mortbay.jetty.Server.handle(Server.java:285)
      at org.mortbay.jetty.HttpConnection.handleRequest(HttpConnection.java:457)
      at org.mortbay.jetty.HttpConnection$RequestHandler.content(HttpConnection.java:765)
      at org.mortbay.jetty.HttpParser.parseNext(HttpParser.java:628)
      at org.mortbay.jetty.HttpParser.parseAvailable(HttpParser.java:203)
      at org.mortbay.jetty.HttpConnection.handle(HttpConnection.java:357)
      at org.mortbay.io.nio.SelectChannelEndPoint.run(SelectChannelEndPoint.java:329)
      at org.mortbay.thread.BoundedThreadPool$PoolThread.run(BoundedThreadPool.java:475)

        Activity

        Hide
        Alejandro Scandroli added a comment -

        Ken

        You have "cascade = CascadeType.ALL" in both sides of the relationship.
        Try removing it from Coach.
        Like this:

        Organization.JAVA
        private Set<Coach> coaches = new HashSet<Coach>();
        @OneToMany(cascade = CascadeType.ALL, fetch = FetchType.EAGER)
        @JoinColumn(name = "organization_id", insertable = true, updatable = true, nullable = true)
        @Collection(child = true)
        @PropertyDescriptor(readOnly = false)
        @OrderBy("lastName")
        public Set<Coach> getCoaches()

        { return coaches; }

        Coach.JAVA
        private Organization organization;
        @ManyToOne(fetch = FetchType.EAGER)
        @JoinColumn(name = "organization_id", insertable = true, updatable = true, nullable = true)
        public Organization getOrganization()

        { return organization; }
        Show
        Alejandro Scandroli added a comment - Ken You have "cascade = CascadeType.ALL" in both sides of the relationship. Try removing it from Coach. Like this: Organization.JAVA private Set<Coach> coaches = new HashSet<Coach>(); @OneToMany(cascade = CascadeType.ALL, fetch = FetchType.EAGER) @JoinColumn(name = "organization_id", insertable = true, updatable = true, nullable = true) @Collection(child = true) @PropertyDescriptor(readOnly = false) @OrderBy("lastName") public Set<Coach> getCoaches() { return coaches; } Coach.JAVA private Organization organization; @ManyToOne(fetch = FetchType.EAGER) @JoinColumn(name = "organization_id", insertable = true, updatable = true, nullable = true) public Organization getOrganization() { return organization; }
        Hide
        Kenneth William Colassi added a comment -

        Thanks Alejandro, that worked... it now explains the disappearance of the parent model.

        So now to focus on the code... save/merge issues...

        The exception received now is:

        Error: org.springframework.orm.hibernate3.HibernateSystemException: a different object with the same identifier value was already associated with the session: roster.model.dto.Organization#1; nested exception is org.hibernate.NonUniqueObjectException: a different object with the same identifier value was already associated with the session: roster.model.dto.Organization#1

        Show
        Kenneth William Colassi added a comment - Thanks Alejandro, that worked... it now explains the disappearance of the parent model. So now to focus on the code... save/merge issues... The exception received now is: Error: org.springframework.orm.hibernate3.HibernateSystemException: a different object with the same identifier value was already associated with the session: roster.model.dto.Organization#1 ; nested exception is org.hibernate.NonUniqueObjectException: a different object with the same identifier value was already associated with the session: roster.model.dto.Organization#1
        Hide
        Kenneth William Colassi added a comment -

        The delete of the child object actually successfully occurred.

        But based on the exception I just posted... it looks like the collection editor is unable to gather itself.

        Show
        Kenneth William Colassi added a comment - The delete of the child object actually successfully occurred. But based on the exception I just posted... it looks like the collection editor is unable to gather itself.
        Hide
        Kenneth William Colassi added a comment -

        Hi Alejandro,

        CollectionCallback.JAVA
        public void remove(PersistenceService persistenceService, Object object)

        { executeOgnlExpression(collectionDescriptor.findRemoveExpression(), object); //persistenceService.save(getModel()); persistenceService.merge(getModel()); }

        The above modification to use merge seems to have resolved this now.

        I am seeing desirable behavior with the collection editor. I can un-hitch (but not delete) child entities using the checkbox collection user interface or I can click on the checkbox link to edit the child entity directly and invoke a delete using the delete button within the child editor.

        The parent gets updated nicely.

        If I had checkin privileges we could all see this in realtime.

        Please review and make further arrangements to the save/merge logic as you deem necessary.

        Ken

        Show
        Kenneth William Colassi added a comment - Hi Alejandro, CollectionCallback.JAVA public void remove(PersistenceService persistenceService, Object object) { executeOgnlExpression(collectionDescriptor.findRemoveExpression(), object); //persistenceService.save(getModel()); persistenceService.merge(getModel()); } The above modification to use merge seems to have resolved this now. I am seeing desirable behavior with the collection editor. I can un-hitch (but not delete) child entities using the checkbox collection user interface or I can click on the checkbox link to edit the child entity directly and invoke a delete using the delete button within the child editor. The parent gets updated nicely. If I had checkin privileges we could all see this in realtime. Please review and make further arrangements to the save/merge logic as you deem necessary. Ken
        Hide
        Kenneth William Colassi added a comment -

        Merge and appropriate usage of hasCyclicRelationships was required to get around this although the design of this area needs to ve revisited.

        Show
        Kenneth William Colassi added a comment - Merge and appropriate usage of hasCyclicRelationships was required to get around this although the design of this area needs to ve revisited.

          People

          • Assignee:
            Alejandro Scandroli
            Reporter:
            Kenneth William Colassi
          • Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved: