Yeah, actually I write my code the same way as you do hosierdm. I haven't tested the code inside appserver, only tested it using a swing base client. What I notice is after I close the jbpmcontext object I can no longer use my hibernate session because it already closed inside JbpmContext.close() method. Even creating a new JbpmContext object again will still use the same hibernate session that has been closed previously. So this code will not work : | | public void deleteUser(String user) { | JbpmContext jbpmContext = _jbpmConfig.createJbpmContext(); | try { | // do some stuff | } | finally { | jbpmContext.close(); | } | | // access persistence layer using hibernate session will throw error | // indicating that the hibernate session is already closed | | //even creating a new JbpmContext like this will not help | jbpmContext = _jbpmConfig.createJbpmContext(); | try { | // do some stuff | } | finally { | jbpmContext.close(); | } | | } |
May be I made a mistake somewhere, but not sure where. I use spring + jbpm based on the code by criess which you can find here : [url] http://www.jboss.com/index.html?module=bb&op=viewtopic&t=78052&start=0&postdays=postDays&postorder=postOrder&highlight=highlight [/url] Basically I let spring to manage my Hibernate session, the JbpmConfiguration and the JbpmContext object creation. By the way, thx for your response hosierdm, well , at least I'm quite sure now that I've used jbpm api quite correctly :p Regards, Martin View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=3950235#3950235 Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=3950235 _______________________________________________ JBoss-user mailing list JBoss-user@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/jboss-user