0 Replies Latest reply on Jun 8, 2006 10:40 AM by Thiago Marafon

    Persistence (Hibernate) problem

    Thiago Marafon Newbie

      I'm having problems using JBPM persistence in my existing J2EE application that uses Hibernate.
      My application already has a sessiosFactory initialized and I'd want that JBPM uses that sessionFactory.
      So I did like that:

      jbpmConfiguration = JbpmConfiguration.parseResource(
       "<jbpm-configuration>" +
      
      
       " <jbpm-context>" +
       " <service name='persistence'>" +
       " <bean factory='org.jbpm.persistence.db.DbPersistenceServiceFactory'>"+
       " <field name='sessionFactoryJndiName'>"+
       " <string value=\"br.com.softplan.seg.dao/SessionFactory' />"+
       " </field> "+
       " </bean>"+
       " </service>" +
       " </jbpm-context>" +
      
      
       " <string name='resource.hibernate.cfg.xml'"+
       " value='hibernateJBPM.cfg.xml' />"+
       " <string name='resource.hibernate.properties'" +
       " value='hibernate.properties' />" +
       " <string name='resource.business.calendar' " +
       " value='org/jbpm/calendar/jbpm.business.calendar.properties' />" +
       " <string name='resource.default.modules' " +
       " value='org/jbpm/graph/def/jbpm.default.modules.properties' />" +
       " <string name='resource.converter' " +
       " value='org/jbpm/db/hibernate/jbpm.converter.properties' />" +
       " <string name='resource.action.types' " +
       " value='org/jbpm/graph/action/action.types.xml' />" +
       " <string name='resource.node.types' " +
       " value='org/jbpm/graph/node/node.types.xml' />" +
       " <string name='resource.varmapping' " +
       " value='org/jbpm/context/exe/jbpm.varmapping.xml' />" +
       "</jbpm-configuration>"
       );


      but when I need to get the Context
      JbpmContext jbpmContext = jbpmConfiguration.createJbpmContext()
      , It keeps searching for a file named hibernate.cfg.xml and not hibernateJBPM.cfg.xml.

      I want him to use the hibernate.properties file, but even if take off the declaration , it keeps looking for the hibernate.cfg.xml.

      Another thing that I found weird is that if I told JBPM to use MY sessionFactory, why does it need the hibernate.cfg.xml file?

      cheers...

      Thiago