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;
}
});