Discussion:
[jboss-user] [jBPM] - Re: Help using persistence with JBPM 5.4
doboss
2013-01-02 17:44:58 UTC
Permalink
doboss [https://community.jboss.org/people/doboss] created the discussion

"Re: Help using persistence with JBPM 5.4"

To view the discussion, visit: https://community.jboss.org/message/787113#787113

--------------------------------------------------------------
Okay, I think by including jbpm-test it is defining the same persistence unit. So I am going to try to do it without the JBPMHelper.
--------------------------------------------------------------

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

Start a new discussion in jBPM at Community
[https://community.jboss.org/choose-container!input.jspa?contentType=1&containerType=14&container=2034]
doboss
2013-01-02 20:50:18 UTC
Permalink
doboss [https://community.jboss.org/people/doboss] created the discussion

"Re: Help using persistence with JBPM 5.4"

To view the discussion, visit: https://community.jboss.org/message/787148#787148

--------------------------------------------------------------
Okay, I got it working by changing the code like this:



@PersistenceUnit(unitName = "org.jbpm.persistence.jpa")
   private EntityManagerFactory emf;

   public void runIt()
   {
      try
      {
         if (kbase == null)
         {
            // load up the knowledge base
            kbase = readKnowledgeBase();
         }
         Environment env = KnowledgeBaseFactory.newEnvironment();
         env.set(EnvironmentName.ENTITY_MANAGER_FACTORY, emf);

         // create a new knowledge session that uses JPA to store the runtime
         // state
         StatefulKnowledgeSession ksession = JPAKnowledgeService.newStatefulKnowledgeSession(kbase, null, env);
         int sessionId = ksession.getId();
         JPAWorkingMemoryDbLogger logger = new JPAWorkingMemoryDbLogger(ksession);



If anyone wants more details, I would be happy to provide them.
--------------------------------------------------------------

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

Start a new discussion in jBPM at Community
[https://community.jboss.org/choose-container!input.jspa?contentType=1&containerType=14&container=2034]
roxy1987
2013-01-04 20:31:18 UTC
Permalink
roxy1987 [https://community.jboss.org/people/roxy1987] created the discussion

"Re: Help using persistence with JBPM 5.4"

To view the discussion, visit: https://community.jboss.org/message/787710#787710

--------------------------------------------------------------
Hey doboss.

I am in a need of your help. Did you change anything in your persistence.xml to achieve the above?
--------------------------------------------------------------

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

Start a new discussion in jBPM at Community
[https://community.jboss.org/choose-container!input.jspa?contentType=1&containerType=14&container=2034]
doboss
2013-01-04 20:47:23 UTC
Permalink
doboss [https://community.jboss.org/people/doboss] created the discussion

"Re: Help using persistence with JBPM 5.4"

To view the discussion, visit: https://community.jboss.org/message/787716#787716

--------------------------------------------------------------
This is my current persistence.xml, I believe I added the <jta-data-source> stuff after the original post.

Here it is:



In my pom.xml I do *not* have a reference to jbpm-test as it causes a conflict with "org.jbpm.persistence.jpa"

I also manually changed (throught the JBoss console) the "H2DS" datasource installed by default with the jbpm-installer to point to my local (postgres) database instead of the H2 one. (Since the have the same persistence-unit name).

Let me know if you need more info.
--------------------------------------------------------------

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

Start a new discussion in jBPM at Community
[https://community.jboss.org/choose-container!input.jspa?contentType=1&containerType=14&container=2034]
roxy1987
2013-01-04 21:38:42 UTC
Permalink
roxy1987 [https://community.jboss.org/people/roxy1987] created the discussion

"Re: Help using persistence with JBPM 5.4"

To view the discussion, visit: https://community.jboss.org/message/787721#787721

--------------------------------------------------------------
Thanks. I cant see the file. Hey will it be possible for you to post your entire code? This history enable thing is a little confusing for me. May the because of the way I have designed my application.

Regards.
--------------------------------------------------------------

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

Start a new discussion in jBPM at Community
[https://community.jboss.org/choose-container!input.jspa?contentType=1&containerType=14&container=2034]
doboss
2013-01-04 22:13:51 UTC
Permalink
doboss [https://community.jboss.org/people/doboss] created the discussion

"Re: Help using persistence with JBPM 5.4"

To view the discussion, visit: https://community.jboss.org/message/787726#787726

--------------------------------------------------------------
Here it is in it's present state. :)

HTH!
--------------------------------------------------------------

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

Start a new discussion in jBPM at Community
[https://community.jboss.org/choose-container!input.jspa?contentType=1&containerType=14&container=2034]
roxy1987
2013-01-04 22:17:55 UTC
Permalink
roxy1987 [https://community.jboss.org/people/roxy1987] created the discussion

"Re: Help using persistence with JBPM 5.4"

To view the discussion, visit: https://community.jboss.org/message/787727#787727

--------------------------------------------------------------
Thanks a million dude.
--------------------------------------------------------------

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

Start a new discussion in jBPM at Community
[https://community.jboss.org/choose-container!input.jspa?contentType=1&containerType=14&container=2034]
doboss
2013-01-11 15:46:17 UTC
Permalink
doboss [https://community.jboss.org/people/doboss] created the discussion

"Re: Help using persistence with JBPM 5.4"

To view the discussion, visit: https://community.jboss.org/message/790453#790453

--------------------------------------------------------------
I have made a much more standalone version of this app, and cleaned it up a bit. For anyone interested, you can now find it here:

https://community.jboss.org/docs/DOC-48240 https://community.jboss.org/wiki/SimpleJBPM54InsideJBossAS711WebAppExample
--------------------------------------------------------------

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

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