5 Replies Latest reply: Apr 11, 2012 4:48 AM by gigazhang RSS

jbpm5 persistence

gigazhang Newbie

I'm studying JBPM5, I can not use JPA, only with Hibernate?


If I could, how to configure it.


Anyone know that?

  • 1. Re: jbpm5 persistence
    gigazhang Newbie

                EntityManagerFactory emfTask = Persistence.createEntityManagerFactory( "org.jbpm.task" );

                TaskService taskService = new TaskService(emfTask, SystemEventListenerFactory.getSystemEventListener());


                /* Start Mina server for HT*/

                MinaTaskServer server = new MinaTaskServer(taskService);

                Thread thread = new Thread(server);




    How do I replace the first line?

  • 2. Re: jbpm5 persistence
    Mauricio Salatino Master

    JPA uses hibernate as a persistence provider, why you cannot use it?

    What you can do if you already have a hibernate session in your app is to create an entity manager, but then inject the hibernate session to that entity manager. But I would love to know why you cannot use JPA.


  • 3. Re: jbpm5 persistence
    gigazhang Newbie

    I don't want to use the JPA, but only hibernate instead,,,,,how to config it..



    when i remove the persistence.xml ,Jbpm5 can't work.

  • 4. Re: jbpm5 persistence
    Mauricio Salatino Master

    So once again, what's the technical reason why you wont to use JPA, jbpm is heavely based on that to be able to support another ORM's like Toplink as well, not just hibernate. If you don't want to use JPA just because you don't want to, you will need to do a lot of changes in the classes inside jBPM in order to make it work. Those changes aren't hard, it's just changing the internal classes annotated with JPA annotations for Hibernate annotations, but I still don't see any valid reason to do that.


  • 5. Re: jbpm5 persistence
    gigazhang Newbie

    JPA use JTA as the distributed transaction frame.


    But I don't want to use the distributed transaction,  because the perfermance


    Is there any way to divert jta?