Hi,
Problem is that jbpm history information is not stored to database when using Spring configuration and Spring managed transactions. I'm using jbpm 4.4 and Spring 3
When I import jbpm.default.cfg.xml configuration on top of my own configuration, then the history data is stored, but I think this overrides the <transaction-context> or something and therefore it creates new transaction for jbpm code insted of reusing existing one.
Below is the configurations that I use:
My jbpm.cfg.xml:
<jbpm-configuration xmlns="http://jbpm.org/xsd/cfg">
<hibernate-session current="true" close="false" />
</transaction-context>
</jbpm-configuration>
My spring xml (part of it):
<bean id="sessionFactory"
class="org.springframework.orm.hibernate3.LocalSessionFactoryBean">
<property name="mappingLocations">
<list>
<value>classpath:jbpm.execution.hbm.xml</value>
<value>classpath:jbpm.repository.hbm.xml</value>
<value>classpath:jbpm.task.hbm.xml</value>
<value>classpath:jbpm.history.hbm.xml</value>
<value>classpath:jbpm.identity.hbm.xml</value>
</list>
</property>
<property name="hibernateProperties">
<props>
<prop key="hibernate.dialect">org.hibernate.dialect.HSQLDialect</prop>
<prop key="hibernate.query.substitutions">true=1 false=0</prop>
<prop key="hibernate.bytecode.use_reflection_optimizer">false</prop>
<prop key="hibernate.show_sql">false</prop>
<prop key="hibernate.format_sql">false</prop>
<prop key="hibernate.use_sql_comments">false</prop>
<prop key="hibernate.jdbc.batch_size">0</prop>
<!--prop key=hibernate.hbm2ddl.auto>update</prop-->
</props>
</property>
<property name="dataSource">
<ref bean="dataSource" />
</property>
</bean>
<bean id="transactionManager"
class="org.springframework.orm.hibernate3.HibernateTransactionManager">
<property name="sessionFactory" ref="sessionFactory" />
</bean>
<bean id="dataSource"
class="org.springframework.jdbc.datasource.DriverManagerDataSource">
<property name="driverClassName" value="org.hsqldb.jdbcDriver" />
<property name="url" value="${db.url}" />
<property name="username" value="${db.username}" />
<property name="password" value="${db.password}" />
</bean>
<bean id="jbpmConfiguration" class="org.jbpm.pvm.internal.processengine.SpringHelper">
<property name="jbpmCfg" value="jbpm.cfg.xml"/>
</bean>
<bean id="processEngine" factory-bean="jbpmConfiguration" factory-method="createProcessEngine"/>