-
1. Re: Persistence unit name for jBPM5
swiderski.maciej Nov 30, 2011 2:04 PM (in response to markboletti)Sure, you can use another persistence unit. When you create session you need to build up environment that contains entity manager factory, and that is the place where you should use your new name.
Alternative, could be to get rid of second instance of persistence unit and reuse that one loaded by console.
HTH
-
2. Re: Persistence unit name for jBPM5
markboletti Dec 1, 2011 5:09 AM (in response to swiderski.maciej)Hello Maciej,
thanks for your reply. You mean I should add the persistence unit name as property ? I can see the KnowledgeBase can be started with a Property file:
Properties properties = new Properties();
properties.setProperty( "org.drools.sequential", "true");
KnowledgeBaseConfiguration kbConf = KnowledgeBaseFactory.newKnowledgeBaseConfiguration(properties, myClassLoader);
KnowledgeBase kbase = KnowledgeBaseFactory.newKnowledgeBase(kbConf);
If so which is the right key to set for the persistence unit name ?
Thanks a lot
Mark
-
3. Re: Persistence unit name for jBPM5
markboletti Dec 1, 2011 5:34 AM (in response to markboletti)Maybe I found it:
EntityManagerFactory emfTask = Persistence.createEntityManagerFactory( "org.jbpm.task" );
is that one the right place to declare the persistence unit ?
regards
Mark
-
4. Re: Persistence unit name for jBPM5
swiderski.maciej Dec 1, 2011 5:42 AM (in response to markboletti)Yes, this is the way you build up entity manager factory but you found for task server and what you are looking for (as original post refers to) is session state persistence.
So you should look for a place in your application where you create stateful sessions rather than knowledge base. There you should utilize JPAKnowledgeService to create session where one of the arguments for the newStatefulKnowledgeSession method is environment that should contain entity manager factory instance.
HTH