4 Replies Latest reply on Jul 3, 2007 4:07 AM by asd asd

    couldn't commit hibernate session

    asd asd Newbie

      Hi all
      I'm trying to signal a newly created ProcessInstance, it sounds workin because I retrieve the current node and I found that it's the second node in the graph, but, when I call jbpmContext.close() to close and flush the session I got the following exception: org.jbpm.persistence.JbpmPersistenceException: couldn't commit hibernate session

      Here is the code

      JbpmConfiguration conf = JbpmConfiguration.parseResource('/home/mustang/jbpm.cfg.xml");
      JbpmContext environment = conf.createJbpmContext();
      GraphSessin graphSession = environment.getGraphSession();
      ProcessDefinition pd = graphSession.findLatestProcessDefinition("AProcessDefinition");
      ProcessInstance pi = new ProcessInstance(pd);
      pi.signal();
      environment.close();
      


      I'd be grateful if anybody could help me
      And here is the full StackTrace:
      org.jbpm.persistence.JbpmPersistenceException: couldn't commit hibernate session
       at org.jbpm.persistence.db.DbPersistenceService.close(DbPersistenceService.java:179)
       at org.jbpm.svc.Services.close(Services.java:211)
       at org.jbpm.JbpmContext.close(JbpmContext.java:139)
       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:597)
       at php.java.bridge.JavaBridge.Invoke(JavaBridge.java:1124)
       at php.java.bridge.Request.handleRequest(Request.java:342)
       at php.java.bridge.Request.handleRequests(Request.java:388)
       at php.java.bridge.JavaBridge.run(JavaBridge.java:215)
       at php.java.bridge.BaseThreadPool$Delegate.run(BaseThreadPool.java:66)
      Caused by: org.hibernate.TransientObjectException: object references an unsaved transient instance - save the transient instance before flushing: org.jbpm.taskmgmt.exe.TaskMgmtInstance
       at org.hibernate.engine.ForeignKeys.getEntityIdentifierIfNotUnsaved(ForeignKeys.java:219)
       at org.hibernate.type.EntityType.getIdentifier(EntityType.java:397)
       at org.hibernate.type.ManyToOneType.isDirty(ManyToOneType.java:242)
       at org.hibernate.type.TypeFactory.findDirty(TypeFactory.java:563)
       at org.hibernate.persister.entity.AbstractEntityPersister.findDirty(AbstractEntityPersister.java:3071)
       at org.hibernate.event.def.DefaultFlushEntityEventListener.dirtyCheck(DefaultFlushEntityEventListener.java:472)
       at org.hibernate.event.def.DefaultFlushEntityEventListener.isUpdateNecessary(DefaultFlushEntityEventListener.java:197)
       at org.hibernate.event.def.DefaultFlushEntityEventListener.onFlushEntity(DefaultFlushEntityEventListener.java:120)
       at org.hibernate.event.def.AbstractFlushingEventListener.flushEntities(AbstractFlushingEventListener.java:196)
       at org.hibernate.event.def.AbstractFlushingEventListener.flushEverythingToExecutions(AbstractFlushingEventListener.java:76)
       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.jbpm.persistence.db.DbPersistenceService.close(DbPersistenceService.java:169)
       ... 11 more
      Jul 01 12:44:20 JavaBridge ERROR: An exception occured: org.jbpm.JbpmException: problem closing services {persistence=org.jbpm.persistence.JbpmPersistenceException: couldn't commit hibernate session}
      org.jbpm.JbpmException: problem closing services {persistence=org.jbpm.persistence.JbpmPersistenceException: couldn't commit hibernate session}
       at org.jbpm.svc.Services.close(Services.java:223)
       at org.jbpm.JbpmContext.close(JbpmContext.java:139)
       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:597)
       at php.java.bridge.JavaBridge.Invoke(JavaBridge.java:1124)
       at php.java.bridge.Request.handleRequest(Request.java:342)
       at php.java.bridge.Request.handleRequests(Request.java:388)
       at php.java.bridge.JavaBridge.run(JavaBridge.java:215)
       at php.java.bridge.BaseThreadPool$Delegate.run(BaseThreadPool.java:66)
      Caused by: org.jbpm.persistence.JbpmPersistenceException: couldn't commit hibernate session
       at org.jbpm.persistence.db.DbPersistenceService.close(DbPersistenceService.java:179)
       at org.jbpm.svc.Services.close(Services.java:211)
       ... 10 more
      Caused by: org.hibernate.TransientObjectException: object references an unsaved transient instance - save the transient instance before flushing: org.jbpm.taskmgmt.exe.TaskMgmtInstance
       at org.hibernate.engine.ForeignKeys.getEntityIdentifierIfNotUnsaved(ForeignKeys.java:219)
       at org.hibernate.type.EntityType.getIdentifier(EntityType.java:397)
       at org.hibernate.type.ManyToOneType.isDirty(ManyToOneType.java:242)
       at org.hibernate.type.TypeFactory.findDirty(TypeFactory.java:563)
       at org.hibernate.persister.entity.AbstractEntityPersister.findDirty(AbstractEntityPersister.java:3071)
       at org.hibernate.event.def.DefaultFlushEntityEventListener.dirtyCheck(DefaultFlushEntityEventListener.java:472)
       at org.hibernate.event.def.DefaultFlushEntityEventListener.isUpdateNecessary(DefaultFlushEntityEventListener.java:197)
       at org.hibernate.event.def.DefaultFlushEntityEventListener.onFlushEntity(DefaultFlushEntityEventListener.java:120)
       at org.hibernate.event.def.AbstractFlushingEventListener.flushEntities(AbstractFlushingEventListener.java:196)
       at org.hibernate.event.def.AbstractFlushingEventListener.flushEverythingToExecutions(AbstractFlushingEventListener.java:76)
       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.jbpm.persistence.db.DbPersistenceService.close(DbPersistenceService.java:169)
       ... 11 more