-
1. Re: Jbpm - EJB LazyInitialization Exception
sreepathia Jun 3, 2008 9:11 AM (in response to jjacobwip)Hi,
I understand your problem, This is because your transaction/session is initiated in EJB and it was completed automatically when you exited the EJB method. when you call processInstance.signal() JBPM will try to use the session associated with the processInstanceobject for updatign the database. which is closed in this scenario, There are couple of ways to do this
1) Try to complete all the database activities in one single method of EJB.
2) If you want to do this in multiple methods/layers then you need to make these both methods in one transaction like, start a transaction before calling the EJB object and end the transaction in your servelet or calling class after completing the process.
Spring has certain API to support thsi functionality,i implemented this in spiring but i am not sure how you will do it in EJB.
Thanks -
2. Re: Jbpm - EJB LazyInitialization Exception
jjacobwip Jun 3, 2008 11:29 AM (in response to jjacobwip)Thank you!! You are right, its working fine when I do all the operations in EJB itself. Also I saw in another thread that Lazy initialization of hibernate is not supported across layers especially in a Servlet - EJB scenario.
Thanks again!!