[jboss-user] [JBoss jBPM] - JobExecutor Problem
jits_1998
do-not-reply at jboss.com
Thu Mar 29 05:45:16 EDT 2007
In JobExecutor, Pending jobs are being retrieved using acquireJobs() by opening new JbpmContext and it is closed in the end.
acquireJobs() is returning list of acquiredJobs. Job contains lazy node,token and taskIntance
In executeJob(), When execute() is called on job. It tries call execute() on node, which is a lazy instance. As the session which has retrieved job in acquireJobs() has been closed. Following exception is being thrown.
Exception in thread "main" ERROR - could not initialize proxy - the owning Session was closed
org.hibernate.LazyInitializationException: could not initialize proxy - the owning Session was closed
at org.hibernate.proxy.AbstractLazyInitializer.initialize(AbstractLazyInitializer.java:53)
at org.hibernate.proxy.AbstractLazyInitializer.getImplementation(AbstractLazyInitializer.java:84)
at org.hibernate.proxy.CGLIBLazyInitializer.intercept(CGLIBLazyInitializer.java:134)
This can be resolved by reloading job in executeJob(). There is a line of code for this purpose
| jobSession.loadJob(job.getId());
|
But, here loaded job is not assigned to Job.
Any comments on how to overcome this problem.
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4032682#4032682
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4032682
More information about the jboss-user
mailing list