1 Reply Latest reply on Feb 4, 2008 9:58 AM by yair friedman

    problem integrating JBPM & HIBERNATE

    yair friedman Newbie

      hi,

      i am trying to integrate the hibernate with the JBPM (that worked fine when we have worked JDBC) .
      i have done it by injecting the hibernate session into the JBPM one :

      JbpmConfiguration conf = JbpmConfiguration.getInstance();
       context = conf.createJbpmContext();
       context.setSession(HibernateSessionFactory.getSession());
      

      the deployment appeared to work fine.
      when i try to do a "start process" , it dosn't appear to insert an entry to the
      JBPM_PROCESSINSTANCE table.
      doesn't the
      context.save(instance);
      should insert an entry to that table ?

      the actual error happens in last line of the following code :
      JbpmContext context = conf.createJbpmContext();
       context.setSession(HibernateSessionFactory.getSession());
       GraphSession graphSession = context.getGraphSession();
       ProcessInstance pi = graphSession.loadProcessInstance(processInstanceNum);
      

      when i try to inspect the pi value in the debug window i see:

      com.sun.jdi.InvocationException occurred invoking method.
      


        • 1. Re: problem integrating JBPM & HIBERNATE
          yair friedman Newbie

          things i didn't mention :
          i am working on SqlServer , and probably some of the definitions are wrong like the c3p0 , it connects to oracle instead to the sqlserver .
          i have this hirarchy :

          home ->
          Config ->
          hibernate.cfg.xml
          hibernate.properties
          where should the jbpm.cfg.xml sit ?
          i put it in the config directory , in web-inf/classes ,
          and it seems to take the default one , because it take the oracle properties.

          16:49:50,247 INFO [STDOUT] 16:49:50,247 INFO [JbpmConfiguration] using jbpm configuration resource 'jbpm.cfg.xml'
          16:49:50,637 INFO [STDOUT] 16:49:50,637 INFO [Environment] Hibernate 3.1
          16:49:50,653 INFO [STDOUT] 16:49:50,653 INFO [Environment] loaded properties from resource hibernate.properties: {hibernate.connection.driver_class=oracle.jdbc.driver.OracleDriver, hibernate.cglib.use_reflection_optimizer=true, hibernate.cache.provider_class=org.hibernate.cache.EhCacheProvider, hibernate.cache.use_query_cache=true, hibernate.c3p0.max_size=20, hibernate.dialect=org.hibernate.dialect.Oracle9Dialect, hibernate.cache.use_second_level_cache=true, hibernate.c3p0.min_size=5, hibernate.query.substitutions=true 1, false 0, hibernate.connection.username=im1online, hibernate.connection.url=jdbc:oracle:thin:@MyIP:1521:MyPassowrd, hibernate.show_sql=true, hibernate.connection.password=****}
          
          

          one other important point :
          the first time i start the process , i see the insert hibernate command
          in the log (to jbpm_processinstance), but when i try to do a query in the DB it seems that the table is locked .
          the second time i try to start this process , i dont see the insert commands
          in the log .

          PLEASE HELP !!!!
          i am preety desperate ....