1 Reply Latest reply on Jun 6, 2009 8:08 AM by freak182

    JBPM sharing DB connection with Spring

    tszymanski

      Hello,
      Does anyone know the easy way to force JBPM to use database connections configured through Spring/Hibernate.
      Currently my JBMP program does it the standard way:

      <string name='resource.hibernate.cfg.xml' value='hibernate.cfg.xml' />


      and then inside hibernate.cfg.xml

      <property name="connection.url">jdbc:oracle:thin:@208.187.32.100:1521:tdev</property>
      etc.


      Inside Spring we have the standard configuration:
      <bean id="DbPropertyConfigurer"
       class="org.springframework.beans.factory.config.PropertyPlaceholderConfigurer">
       <property name="location" value="jdbc.properties" />
       </bean>
      
       <bean id="dataSource" class="org.apache.commons.dbcp.BasicDataSource"
       destroy-method="close">
       <property name="driverClassName">
       <value>${database.driver}</value>
       </property>
       <property name="url">
       <value>${database.url}</value>
       </property>
       <property name="username">
       <value>${database.user}</value>
       </property>
       <property name="password">
       <value>${database.password}</value>
       </property>
       </bean>
      

      How do I tell JBPM to use the same connection parameters as the ones in Spring?

      As a followup question, how do I configure connection sharing (and thus tsx management) between Spring-configured beans and the DB operations within my JBPM code?
      I do not want to springy-fy my entire JBPM code if I can avoid it.

      I'd appreciate any hints