[jboss-user] [JBoss jBPM] - Jbpm - EJB LazyInitialization Exception
jjacobwip
do-not-reply at jboss.com
Tue Jun 3 01:33:44 EDT 2008
Hi,
I was trying to learn jbpm and came across this scenario.
I was trying to create a Session Facade for my Process related activities (instantiate process instance, list tasks etc). I created a basic CMP EJB and added method to instantiate a ProcessInstance which is already deployed. For testing, I am calling this EJB method from a servlet using the remote interface of the EJB.
In my EJB method, I am creating a new instance of my business process which is already deployed. This method returns the newly created ProcessInstance. After that, in my servlet I am calling processInstance.signal()= and getting the below exception.
18:42:12,484 ERROR [LazyInitializationException] failed to lazily initialize a collection of role: org.jbpm.graph.def.Node.leavingTransitions, no session or session was closed
org.hibernate.LazyInitializationException
: failed to lazily initialize a collection of role: org.jbpm.graph.def.Node.leavingTransitions, no session or session was closed
at org.hibernate.collection.AbstractPersistentCollection.throwLazyInitializationException(
AbstractPersistentCollection.java:358)
at org.hibernate.collection.AbstractPersistentCollection.throwLazyInitializationExceptionIfNotConnected(
AbstractPersistentCollection.java:350)
If I do processInstance.signal() from my EJB itself, everything is working fine.
I do understand that its a bad design to tightly couple the servlet and the EJB layer and there could be transaction issues, but just wanted to doube confirm it.
Thanks in advance
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4155199#4155199
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4155199
More information about the jboss-user
mailing list