-
1. Re: saving own objects with Hibernate in jbpm
jits_1998 Sep 8, 2006 1:39 PM (in response to jbaton)Heyi Jerome,
Can you explain a bit more as to where you are using the custom objects? Is it custom module instance or custom objects stored in context instance .. or is it custom nodes ??
have a look at this :
http://www.jboss.com/index.html?module=bb&op=viewtopic&p=3970268#3970268
cheers! -
2. Re: saving own objects with Hibernate in jbpm
jbaton Sep 12, 2006 5:46 AM (in response to jbaton)Hi jits_1998,
As an example, my principal custom object has, amongst its fields, a long that is an id of a jbpm process instance.
This custom object is saved in DB by Hibernate through a regular session while the jbpm process instance is saved using a jbpmcontext.
The hib. session is obtained from the same configuration as jbpm, for having the (few) tables in the same schema is not an issue.public static Session createPersistantSession() { DbPersistenceServiceFactory dbPersistenceServiceFactory = (DbPersistenceServiceFactory) instanceConfigurationJbpm.getServiceFactory("persistence"); return dbPersistenceServiceFactory.getSessionFactory().openSession() ; }
Right now, the issue in the post above is not anymore but I am facing a new one about contexts closed more than once
I'm using version 3.211:11:03,653 [Thread-3] ERROR DbPersistenceService : problem rolling back after failed commit org.hibernate.TransactionException: Transaction not successfully started at org.hibernate.transaction.JDBCTransaction.rollback(JDBCTransaction.java:149) at org.jbpm.persistence.db.DbPersistenceService.close(DbPersistenceService.java:166) at org.jbpm.svc.Services.close(Services.java:211) at org.jbpm.JbpmContext.close(JbpmContext.java:139) at com.aspheria.cerbere.Workflow.run(Workflow.java:515) at java.lang.Thread.run(Thread.java:534) 11:11:03,653 [Thread-3] ERROR Services : problem closing service 'persistence' org.jbpm.persistence.JbpmPersistenceException: couldn't commit hibernate session at org.jbpm.persistence.db.DbPersistenceService.close(DbPersistenceService.java:172) at org.jbpm.svc.Services.close(Services.java:211) at org.jbpm.JbpmContext.close(JbpmContext.java:139) at com.xxxx.cerbere.Workflow.run(Workflow.java:515) at java.lang.Thread.run(Thread.java:534) Caused by: org.hibernate.TransactionException: Transaction not successfully started at org.hibernate.transaction.JDBCTransaction.commit(JDBCTransaction.java:100) at org.jbpm.persistence.db.DbPersistenceService.close(DbPersistenceService.java:162) ... 4 more ... 4 more org.jbpm.JbpmException: closed JbpmContext more then once... check your try-finally's around JbpmContexts blocks at org.jbpm.JbpmConfiguration.popJbpmContext(JbpmConfiguration.java:521) at org.jbpm.JbpmConfiguration.jbpmContextClosed(JbpmConfiguration.java:537) at org.jbpm.JbpmContext.close(JbpmContext.java:144) at com.xxxx.cerbere.Workflow.run(Workflow.java:515) at java.lang.Thread.run(Thread.java:534)
Thanks for your help
JBaton -
3. Re: saving own objects with Hibernate in jbpm
jits_1998 Sep 12, 2006 9:19 AM (in response to jbaton)Is your problem similar to this?
http://www.jboss.com/index.html?module=bb&op=viewtopic&p=3971000#3971000
I think it is. Lets wait for a solution from someone on this.
I am also just a couple of weeks old jBPM user.
cheers!