This content has been marked as final.
Show 2 replies
-
1. Get hibernate session for own query
tdtappe May 18, 2011 12:59 PM (in response to tdtappe)BTW, when I try to add (the missing?) mappings to the JPA persistence unit via
<mapping-file>jbpm.repository.hbm.xml</mapping-file>
<mapping-file>jbpm.execution.hbm.xml</mapping-file>
<mapping-file>jbpm.history.hbm.xml</mapping-file>
<mapping-file>jbpm.task.hbm.xml</mapping-file>
I run into an exception:
java.lang.UnsupportedOperationException: any not supported yet
--Heiko
-
2. Re: Get hibernate session for own query
tdtappe May 19, 2011 5:26 AM (in response to tdtappe)The following code seems to work for me:
EnvironmentImpl environment = EnvironmentImpl.getCurrent();
if (environment == null) {
environment = ((EnvironmentFactory) processEngine).openEnvironment();
}
Session session = environment.get(Session.class);
But is this the way to go? If so, do I have to care about "closing" the environment?
--Heiko