[jboss-user] [jBPM] - [Q] JBPM 4.4 JbpmException

Michael Wohlfart do-not-reply at jboss.com
Tue Jul 27 12:43:00 EDT 2010


Michael Wohlfart [http://community.jboss.org/people/mwohlf] replied to the discussion

"[Q] JBPM 4.4 JbpmException"

To view the discussion, visit: http://community.jboss.org/message/554660#554660

--------------------------------------------------------------
The problem is there is a database session needed if you call some of the methods, especially on the persistent objects like task, execution, process etc.... that's just the nature of mapping objects to a database, it is not a bug...

you can:
* stick with the methods of the services (RepositoryService, IdentityService, etc)
* open/close an environment that manages the session for you (see developers guide section 6.5):
EnvironmentImpl environment = (EnvironmentImpl) ((EnvironmentFactory)processEngine).openEnvironment();
try {
  // do yout stuff here
} finally {
  environment.close();
}
* create a command that is executed by the process engine (see developers guide section 6.6):
processEngine.execute(new Command() {
  public Object execute(Environment env) {
    // do your stuff here
    return null;
  }
});

--------------------------------------------------------------

Reply to this message by going to Community
[http://community.jboss.org/message/554660#554660]

Start a new discussion in jBPM at Community
[http://community.jboss.org/choose-container!input.jspa?contentType=1&containerType=14&container=2034]

-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.jboss.org/pipermail/jboss-user/attachments/20100727/1e41f0b1/attachment-0001.html 


More information about the jboss-user mailing list