Details
-
Bug
-
Resolution: Unresolved
-
Major
-
jBPM 4.4
-
Low
-
Description
It is possible to specify the factory name to be used by JBPM when using the spring integration via springhelper.
This is done via:
jbpm.tx.spring.cfg.xml
<transaction-context> <transaction type="spring" /> <hibernate-session current="true" factory="sessionFactory"/> </transaction-context>
However when the processengine is constructed, this name is not used, and a type search in the application context is done instead:
SpringProcessEngine.java
if (configuration.isInstantiatedFromSpring()) { applicationContext = (ApplicationContext) configuration.getApplicationContext(); springProcessEngine = new SpringProcessEngine(); springProcessEngine.applicationContext = applicationContext; springProcessEngine.initializeProcessEngine(configuration); LocalSessionFactoryBean localSessionFactoryBean = springProcessEngine.get(LocalSessionFactoryBean.class); // WRONG... //... }
This code above is only used during init to run db checks I think. However when multiple session factories are available, this code may end up using the wrong LSFB:
Multiple beans for type class org.springframework.orm.hibernate3.LocalSessionFactoryBean found. Returning the first result.
SpringProcessEngine should used the name in the XML, or (less desirable) use a spring-supplied name (via springhelper property?).