javax.persistence.RollbackException: Error while commiting the transaction

openxava | henryedsl | 6 years ago
  1. 0

    Referencia @Transient

    openxava | 6 years ago | henryedsl
    javax.persistence.RollbackException: Error while commiting the transaction
  2. 0

    [EJB-236] EntityManager Exception when closing transaction (Fetch.LAZY) takes no affect - Hibernate JIRA

    atlassian.net | 1 year ago
    javax.persistence.RollbackException: Error while commiting the transaction
  3. 0

    Hi gurus, I just played a little bit arround with the Hibernate Entity Manager and found a bug which is nearly similar to a already closed bug: http://opensource.atlassian.com/projects/hibernate/browse/EJB-221 I've done an updated of all jar files of the "fix version/s 3.2.0.cr3 but this didn't help. I'm using EntityManager and reading by id a Project object out of the database which has a number of oneToMany references within. All references are declared as Fetch.LAZY but using hibernates EntityManager does this not take into account. When committing the transaction I get an Caused by: org.hibernate.TransientObjectException: object references an unsaved transient instance - save the transient instance before flushing: com.arvato.hibernate.entities.Tras001.tras070 -> com.arvato.hibernate.entities.Tras070 without saving anything, I do just a simple read?! So we've two errors here, 1. Why are Fetch.LAZY things read by default (Affected: EntityManager with annotation configuration and xml configuration as well) 2. TransientObjectException (Affected: EntityManager with annotation configuration. XML configuration does not throw this but does a read of lazy objects) I'll attach the Domain Object and the test class to make some things more clear to you. Cheers Meinolf P.S: There is another bug I found a few days ago regarding a wrong binding order of parameters. Can you please take a look at http://forum.hibernate.org/viewtopic.php?t=965575 This happens only when using annotation configuration. (Affected: Session and EntityManager) Here's the full stack trace: javax.persistence.RollbackException: Error while commiting the transaction at org.hibernate.ejb.TransactionImpl.commit(TransactionImpl.java:63) at com.arvato.hibernate.entities.test.HibernateEntityManagerTest.load(HibernateEntityManagerTest.java:71) at com.arvato.hibernate.entities.test.HibernateEntityManagerTest.main(HibernateEntityManagerTest.java:31) Caused by: org.hibernate.TransientObjectException: object references an unsaved transient instance - save the transient instance before flushing: com.arvato.hibernate.entities.Tras001.tras070 -> com.arvato.hibernate.entities.Tras070 at org.hibernate.engine.CascadingAction$9.noCascade(CascadingAction.java:350) at org.hibernate.engine.Cascade.cascade(Cascade.java:139) at org.hibernate.event.def.AbstractFlushingEventListener.cascadeOnFlush(AbstractFlushingEventListener.java:130) at org.hibernate.event.def.AbstractFlushingEventListener.prepareEntityFlushes(AbstractFlushingEventListener.java:121) at org.hibernate.event.def.AbstractFlushingEventListener.flushEverythingToExecutions(AbstractFlushingEventListener.java:65) at org.hibernate.event.def.DefaultFlushEventListener.onFlush(DefaultFlushEventListener.java:26) at org.hibernate.impl.SessionImpl.flush(SessionImpl.java:1000) at org.hibernate.impl.SessionImpl.managedFlush(SessionImpl.java:338) at org.hibernate.transaction.JDBCTransaction.commit(JDBCTransaction.java:106) at org.hibernate.ejb.TransactionImpl.commit(TransactionImpl.java:53) ... 2 more Exception in thread "main" java.lang.IllegalStateException: Transaction not active at org.hibernate.ejb.TransactionImpl.rollback(TransactionImpl.java:74) at com.arvato.hibernate.entities.test.HibernateEntityManagerTest.load(HibernateEntityManagerTest.java:77) at com.arvato.hibernate.entities.test.HibernateEntityManagerTest.main(HibernateEntityManagerTest.java:31)

    Hibernate JIRA | 1 decade ago | Meinolf
    javax.persistence.RollbackException: Error while commiting the transaction
  4. Speed up your debug routine!

    Automated exception search integrated into your IDE

  5. 0

    OpenXava / Discussion / Open Discussion (NOT FOR HELP):obtener valores de otras entidades en un OnChange

    sourceforge.net | 1 year ago
    javax.persistence.RollbackException: Error while committing the transaction
  6. 0

    obtener valores de otras entidades en un OnChange

    openxava | 4 years ago | tatiago
    javax.persistence.RollbackException: Error while committing the transaction

    1 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.TransientObjectException

      object references an unsaved transient instance - save the transient instance before flushing: org.admon.db.compras.modelo.Ods.moneda -> org.admon.db.compras.modelo.Moneda

      at org.hibernate.engine.CascadingAction$9.noCascade()
    2. Hibernate
      Cascade.cascade
      1. org.hibernate.engine.CascadingAction$9.noCascade(CascadingAction.java:376)
      2. org.hibernate.engine.Cascade.cascade(Cascade.java:162)
      2 frames
    3. Hibernate
      SessionImpl.managedFlush
      1. org.hibernate.event.def.AbstractFlushingEventListener.cascadeOnFlush(AbstractFlushingEventListener.java:154)
      2. org.hibernate.event.def.AbstractFlushingEventListener.prepareEntityFlushes(AbstractFlushingEventListener.java:145)
      3. org.hibernate.event.def.AbstractFlushingEventListener.flushEverythingToExecutions(AbstractFlushingEventListener.java:88)
      4. org.hibernate.event.def.DefaultFlushEventListener.onFlush(DefaultFlushEventListener.java:49)
      5. org.hibernate.impl.SessionImpl.flush(SessionImpl.java:1027)
      6. org.hibernate.impl.SessionImpl.managedFlush(SessionImpl.java:365)
      6 frames
    4. Hibernate
      JDBCTransaction.commit
      1. org.hibernate.transaction.JDBCTransaction.commit(JDBCTransaction.java:137)
      1 frame
    5. Hibernate EJB
      TransactionImpl.commit
      1. org.hibernate.ejb.TransactionImpl.commit(TransactionImpl.java:54)
      1 frame
    6. org.openxava.jpa
      XPersistence.commit
      1. org.openxava.jpa.XPersistence.commit(XPersistence.java:134)
      1 frame
    7. org.openxava.controller
      ModuleManager.execute
      1. org.openxava.controller.ModuleManager.doCommit(ModuleManager.java:603)
      2. org.openxava.controller.ModuleManager.executeAction(ModuleManager.java:498)
      3. org.openxava.controller.ModuleManager.executeAction(ModuleManager.java:291)
      4. org.openxava.controller.ModuleManager.execute(ModuleManager.java:251)
      4 frames
    8. org.apache.jsp
      execute_jsp._jspService
      1. org.apache.jsp.xava.execute_jsp._jspService(execute_jsp.java:177)
      1 frame
    9. GWT dev
      HttpJspBase.service
      1. org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:70)
      1 frame
    10. JavaServlet
      HttpServlet.service
      1. javax.servlet.http.HttpServlet.service(HttpServlet.java:717)
      1 frame
    11. GWT dev
      JspServlet.service
      1. org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:374)
      2. org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:342)
      3. org.apache.jasper.servlet.JspServlet.service(JspServlet.java:267)
      3 frames
    12. JavaServlet
      HttpServlet.service
      1. javax.servlet.http.HttpServlet.service(HttpServlet.java:717)
      1 frame
    13. Glassfish Core
      ApplicationDispatcher.include
      1. org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:290)
      2. org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
      3. org.apache.catalina.core.ApplicationDispatcher.invoke(ApplicationDispatcher.java:646)
      4. org.apache.catalina.core.ApplicationDispatcher.doInclude(ApplicationDispatcher.java:551)
      5. org.apache.catalina.core.ApplicationDispatcher.include(ApplicationDispatcher.java:488)
      5 frames
    14. org.openxava.web
      Module.request
      1. org.openxava.web.servlets.Servlets.getURIAsStream(Servlets.java:66)
      2. org.openxava.web.dwr.Module.getURIAsStream(Module.java:182)
      3. org.openxava.web.dwr.Module.request(Module.java:63)
      3 frames
    15. Java RT
      Method.invoke
      1. sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
      2. sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
      3. sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
      4. java.lang.reflect.Method.invoke(Method.java:616)
      4 frames
    16. 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
    17. JavaServlet
      HttpServlet.service
      1. javax.servlet.http.HttpServlet.service(HttpServlet.java:637)
      2. javax.servlet.http.HttpServlet.service(HttpServlet.java:717)
      2 frames
    18. Glassfish Core
      ApplicationFilterChain.doFilter
      1. org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:290)
      2. org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
      2 frames
    19. org.insisto.general
      LifeTimeFilter.doFilter
      1. org.insisto.general.security.utils.LifeTimeFilter.doFilter(LifeTimeFilter.java:113)
      1 frame
    20. Glassfish Core
      CoyoteAdapter.service
      1. org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235)
      2. org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
      3. org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:233)
      4. org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:191)
      5. org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:128)
      6. org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:102)
      7. org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109)
      8. org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:293)
      8 frames
    21. Grizzly HTTP
      JIoEndpoint$Worker.run
      1. org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:849)
      2. org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:583)
      3. org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:454)
      3 frames
    22. Java RT
      Thread.run
      1. java.lang.Thread.run(Thread.java:636)
      1 frame