4 Replies Latest reply on Sep 10, 2005 6:24 AM by Tom Baeyens

    Problem on commitTransaction, plz help

    chen sammy Newbie

      I'm using MS SQL, when I want to save the process instance and call the commitTransaction() method, it gives follow Exception:

      16:53:26,546 ERROR JbpmSession : org.hibernate.TransientObjectException: object references an unsaved transient instance - save the transient instance before flushing: org.jbpm.graph.node.TaskNode
      
       at org.hibernate.type.EntityType.isDirty(EntityType.java:216)
       at org.hibernate.type.TypeFactory.findDirty(TypeFactory.java:412)
       at org.hibernate.persister.entity.BasicEntityPersister.findDirty(BasicEntityPersister.java:2538)
       at org.hibernate.event.def.DefaultFlushEntityEventListener.dirtyCheck(DefaultFlushEntityEventListener.java:344)
       at org.hibernate.event.def.DefaultFlushEntityEventListener.onFlushEntity(DefaultFlushEntityEventListener.java:108)
       at org.hibernate.event.def.AbstractFlushingEventListener.flushEntities(AbstractFlushingEventListener.java:190)
       at org.hibernate.event.def.AbstractFlushingEventListener.flushEverythingToExecutions(AbstractFlushingEventListener.java:70)
       at org.hibernate.event.def.DefaultFlushEventListener.onFlush(DefaultFlushEventListener.java:26)
       at org.hibernate.impl.SessionImpl.flush(SessionImpl.java:730)
       at org.jbpm.db.JbpmSession.commitTransaction(JbpmSession.java:102)
       ... 1 more
      


      here is my code to save process instance:
       JbpmSession jbpmSession = jbpmSessionFactory.openJbpmSession();
      
       jbpmSession.beginTransaction();
      
       jbpmSession.getGraphSession().saveProcessInstance(processInstance);
      
       jbpmSession.commitTransaction();
      
       jbpmSession.close();
      



      my hibernate.properties file:
      hibernate.dialect=org.hibernate.dialect.SQLServerDialect
      hibernate.connection.driver_class=net.sourceforge.jtds.jdbc.Driver
      hibernate.connection.url=jdbc:jtds:sqlserver://localhost:1433/jbpmtest;sql.enforce_strict_size=true
      hibernate.connection.username=sa
      hibernate.connection.password=root123
      hibernate.transaction.factory_class org.hibernate.transaction.JDBCTransactionFactory
      hibernate.cache.provider_class org.hibernate.cache.EhCacheProvider
      hibernate.show_sql=true
      hibernate.c3p0.min_size=5
      hibernate.c3p0.max_size=20
      hibernate.c3p0.timeout=1800
      hibernate.c3p0.max_statements=50
      hibernate.query.substitutions=true 1, false 0
      hibernate.jdbc.use_scrollable_resultset=true
      hibernate.jdbc.use_streams_for_binary=true
      jta.UserTransaction=jndi
      


      Has anybody can help me?
      thanks