javax.persistence.PersistenceException: org.hibernate.HibernateException: identifier of an instance of org.navigo.gena3.modelo.Articulo was altered from 1 to 2

openxava | pespadas | 5 months ago
  1. 0

    Fallo en valores calculados al cambiar referencia

    openxava | 5 months ago | pespadas
    javax.persistence.PersistenceException: org.hibernate.HibernateException: identifier of an instance of org.navigo.gena3.modelo.Articulo was altered from 1 to 2
  2. 0

    When you initialize the collection of an OneToMany relation with {{orphanRemoval=true}} with {{null}}, Hibernate fails to persist changes to a (re)loaded entity with the following exception: {code} org.hibernate.HibernateException: A collection with cascade="all-delete-orphan" was no longer referenced by the owning entity instance: ... at org.hibernate.engine.internal.Collections.processDereferencedCollection(Collections.java:114) at org.hibernate.engine.internal.Collections.processUnreachableCollection(Collections.java:67) at org.hibernate.event.internal.AbstractFlushingEventListener.flushCollections(AbstractFlushingEventListener.java:258) at org.hibernate.event.internal.AbstractFlushingEventListener.flushEverythingToExecutions(AbstractFlushingEventListener.java:103) at org.hibernate.event.internal.DefaultFlushEventListener.onFlush(DefaultFlushEventListener.java:55) at org.hibernate.internal.SessionImpl.flush(SessionImpl.java:1258) at org.hibernate.jpa.spi.AbstractEntityManagerImpl.flush(AbstractEntityManagerImpl.java:1335) {code} Things work however, if * the collection is initialized with an empty collection (instead of {{null}}) * orphanRemoval is set to false This may be related to HHH-7726 and/or HHH-9935, but the null collection case is not covered there. You may find a small stripped down test project on Github https://github.com/abenneke/sandbox/tree/master/hibernate-null-collection Thank you!

    Hibernate JIRA | 1 year ago | Andreas Benneke
    org.hibernate.HibernateException: A collection with cascade="all-delete-orphan" was no longer referenced by the owning entity instance: ...
  3. 0

    Hibernate exceptions while executing jobs

    https://bugzilla.redhat.com/bugzilla/ | 1 year ago | Israel Pinto
    javax.persistence.PersistenceException: org.hibernate.HibernateException: A collection with cascade="all-delete-orphan" was no longer referenced by the owning entity instance: org.ovirt.engine.core.common.job.Job.steps
  4. Speed up your debug routine!

    Automated exception search integrated into your IDE

  5. 0

    When you initialize the collection of an OneToMany relation with {{orphanRemoval=true}} with {{null}}, Hibernate fails to persist changes to a (re)loaded entity with the following exception: {code} org.hibernate.HibernateException: A collection with cascade="all-delete-orphan" was no longer referenced by the owning entity instance: ... at org.hibernate.engine.internal.Collections.processDereferencedCollection(Collections.java:114) at org.hibernate.engine.internal.Collections.processUnreachableCollection(Collections.java:67) at org.hibernate.event.internal.AbstractFlushingEventListener.flushCollections(AbstractFlushingEventListener.java:258) at org.hibernate.event.internal.AbstractFlushingEventListener.flushEverythingToExecutions(AbstractFlushingEventListener.java:103) at org.hibernate.event.internal.DefaultFlushEventListener.onFlush(DefaultFlushEventListener.java:55) at org.hibernate.internal.SessionImpl.flush(SessionImpl.java:1258) at org.hibernate.jpa.spi.AbstractEntityManagerImpl.flush(AbstractEntityManagerImpl.java:1335) {code} Things work however, if * the collection is initialized with an empty collection (instead of {{null}}) * orphanRemoval is set to false This may be related to HHH-7726 and/or HHH-9935, but the null collection case is not covered there. You may find a small stripped down test project on Github https://github.com/abenneke/sandbox/tree/master/hibernate-null-collection Thank you!

    Hibernate JIRA | 1 year ago | Andreas Benneke
    org.hibernate.HibernateException: A collection with cascade="all-delete-orphan" was no longer referenced by the owning entity instance: ...
  6. 0

    hibernate error Don't change the reference to a collection with cascade="all-delete-orphan" on flush

    Stack Overflow | 2 years ago | user3090074
    org.hibernate.HibernateException: Don't change the reference to a collection with cascade="all-delete-orphan": com.ipc.callcenter.orm.ContractWithManagementCompanyDocumentModel.buildings

    2 unregistered visitors
    Not finding the right solution?
    Take a tour to get the most out of Samebug.

    Tired of useless tips?

    Automated exception search integrated into your IDE

    Root Cause Analysis

    1. org.hibernate.HibernateException

      identifier of an instance of org.navigo.gena3.modelo.Articulo was altered from 1 to 2

      at org.hibernate.event.internal.DefaultFlushEntityEventListener.checkId()
    2. Hibernate
      SessionImpl.flush
      1. org.hibernate.event.internal.DefaultFlushEntityEventListener.checkId(DefaultFlushEntityEventListener.java:80)
      2. org.hibernate.event.internal.DefaultFlushEntityEventListener.getValues(DefaultFlushEntityEventListener.java:192)
      3. org.hibernate.event.internal.DefaultFlushEntityEventListener.onFlushEntity(DefaultFlushEntityEventListener.java:152)
      4. org.hibernate.event.internal.AbstractFlushingEventListener.flushEntities(AbstractFlushingEventListener.java:231)
      5. org.hibernate.event.internal.AbstractFlushingEventListener.flushEverythingToExecutions(AbstractFlushingEventListener.java:102)
      6. org.hibernate.event.internal.DefaultFlushEventListener.onFlush(DefaultFlushEventListener.java:55)
      7. org.hibernate.internal.SessionImpl.flush(SessionImpl.java:1258)
      7 frames
    3. org.hibernate.jpa
      AbstractEntityManagerImpl.flush
      1. org.hibernate.jpa.spi.AbstractEntityManagerImpl.flush(AbstractEntityManagerImpl.java:1335)
      1 frame
    4. org.openxava.jpa
      EntityManagerDecorator.flush
      1. org.openxava.jpa.impl.EntityManagerDecorator.flush(EntityManagerDecorator.java:157)
      1 frame
    5. org.openxava.model
      MapFacade.findEntity
      1. org.openxava.model.impl.JPAPersistenceProvider.flush(JPAPersistenceProvider.java:97)
      2. org.openxava.model.impl.JPAPersistenceProvider.find(JPAPersistenceProvider.java:26)
      3. org.openxava.model.impl.POJOPersistenceProviderBase.find(POJOPersistenceProviderBase.java:92)
      4. org.openxava.model.impl.POJOPersistenceProviderBase.find(POJOPersistenceProviderBase.java:63)
      5. org.openxava.model.impl.MapFacadeBean.findEntity(MapFacadeBean.java:1576)
      6. org.openxava.model.impl.MapFacadeBean.findEntity(MapFacadeBean.java:1720)
      7. org.openxava.model.impl.MapFacadeBean.findEntity(MapFacadeBean.java:219)
      8. org.openxava.model.MapFacade.findEntity(MapFacade.java:634)
      8 frames
    6. org.openxava.view
      View.assignValuesToWebView
      1. org.openxava.view.View.getPOJO(View.java:3216)
      2. org.openxava.view.View.calculateValue(View.java:3161)
      3. org.openxava.view.View.tryPropertyChanged(View.java:2940)
      4. org.openxava.view.View.propertyChanged(View.java:2924)
      5. org.openxava.view.View.propertyChanged(View.java:2906)
      6. org.openxava.view.View.setValueNotifying(View.java:1132)
      7. org.openxava.view.View.calculateValue(View.java:3182)
      8. org.openxava.view.View.tryPropertyChanged(View.java:2940)
      9. org.openxava.view.View.propertyChanged(View.java:2924)
      10. org.openxava.view.View.propertyChanged(View.java:2906)
      11. org.openxava.view.View.setValueNotifying(View.java:1132)
      12. org.openxava.view.View.calculateValue(View.java:3182)
      13. org.openxava.view.View.tryPropertyChanged(View.java:2944)
      14. org.openxava.view.View.propertyChanged(View.java:2924)
      15. org.openxava.view.View.propertyChanged(View.java:2909)
      16. org.openxava.view.View.propertyChanged(View.java:2894)
      17. org.openxava.view.View.assignValuesToWebView(View.java:2507)
      18. org.openxava.view.View.assignValuesToWebView(View.java:2470)
      18 frames
    7. org.apache.jsp
      execute_jsp._jspService
      1. org.apache.jsp.xava.execute_jsp._jspService(execute_jsp.java:190)
      1 frame
    8. GWT dev
      HttpJspBase.service
      1. org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:70)
      1 frame
    9. JavaServlet
      HttpServlet.service
      1. javax.servlet.http.HttpServlet.service(HttpServlet.java:728)
      1 frame
    10. GWT dev
      JspServlet.service
      1. org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:432)
      2. org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:390)
      3. org.apache.jasper.servlet.JspServlet.service(JspServlet.java:334)
      3 frames
    11. JavaServlet
      HttpServlet.service
      1. javax.servlet.http.HttpServlet.service(HttpServlet.java:728)
      1 frame
    12. Glassfish Core
      ApplicationDispatcher.include
      1. org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:305)
      2. org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:210)
      3. org.apache.catalina.core.ApplicationDispatcher.invoke(ApplicationDispatcher.java:749)
      4. org.apache.catalina.core.ApplicationDispatcher.doInclude(ApplicationDispatcher.java:605)
      5. org.apache.catalina.core.ApplicationDispatcher.include(ApplicationDispatcher.java:544)
      5 frames
    13. org.openxava.web
      Module.request
      1. org.openxava.web.servlets.Servlets.getURIAsStream(Servlets.java:66)
      2. org.openxava.web.dwr.Module.getURIAsStream(Module.java:202)
      3. org.openxava.web.dwr.Module.request(Module.java:61)
      3 frames
    14. Java RT
      Method.invoke
      1. sun.reflect.GeneratedMethodAccessor259.invoke(Unknown Source)
      2. sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
      3. java.lang.reflect.Method.invoke(Method.java:497)
      3 frames
    15. Direct Web Remoting
      DwrServlet.doPost
      1. org.directwebremoting.impl.ExecuteAjaxFilter.doFilter(ExecuteAjaxFilter.java:34)
      2. org.directwebremoting.impl.DefaultRemoter$1.doFilter(DefaultRemoter.java:428)
      3. org.directwebremoting.impl.DefaultRemoter.execute(DefaultRemoter.java:431)
      4. org.directwebremoting.impl.DefaultRemoter.execute(DefaultRemoter.java:283)
      5. org.directwebremoting.servlet.PlainCallHandler.handle(PlainCallHandler.java:52)
      6. org.directwebremoting.servlet.UrlProcessor.handle(UrlProcessor.java:101)
      7. org.directwebremoting.servlet.DwrServlet.doPost(DwrServlet.java:146)
      7 frames
    16. JavaServlet
      HttpServlet.service
      1. javax.servlet.http.HttpServlet.service(HttpServlet.java:647)
      2. javax.servlet.http.HttpServlet.service(HttpServlet.java:728)
      2 frames
    17. Glassfish Core
      ApplicationFilterChain.doFilter
      1. org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:305)
      2. org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:210)
      2 frames
    18. Tomcat WS
      WsFilter.doFilter
      1. org.apache.tomcat.websocket.server.WsFilter.doFilter(WsFilter.java:52)
      1 frame
    19. Glassfish Core
      CoyoteAdapter.service
      1. org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:243)
      2. org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:210)
      3. org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:222)
      4. org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:123)
      5. org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:502)
      6. org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:171)
      7. org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:100)
      8. org.apache.catalina.valves.AccessLogValve.invoke(AccessLogValve.java:953)
      9. org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:118)
      10. org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:409)
      10 frames
    20. Grizzly HTTP
      JIoEndpoint$SocketProcessor.run
      1. org.apache.coyote.http11.AbstractHttp11Processor.process(AbstractHttp11Processor.java:1044)
      2. org.apache.coyote.AbstractProtocol$AbstractConnectionHandler.process(AbstractProtocol.java:607)
      3. org.apache.tomcat.util.net.JIoEndpoint$SocketProcessor.run(JIoEndpoint.java:313)
      3 frames
    21. Java RT
      Thread.run
      1. java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
      2. java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
      3. java.lang.Thread.run(Thread.java:745)
      3 frames