]
Alejandro Guizar updated JBPM-2942:
-----------------------------------
Fix Version/s: jBPM 4.x
springprocessengine does not use the sessionfactory name supplied in
the cfg.xml file to get the LocalSessionFactoryBean
------------------------------------------------------------------------------------------------------------------------
Key: JBPM-2942
URL:
https://jira.jboss.org/browse/JBPM-2942
Project: jBPM
Issue Type: Bug
Security Level: Public(Everyone can see)
Components: Runtime Engine
Affects Versions: jBPM 4.4
Environment: all
Reporter: Renaud Bruyeron
Labels: spring
Fix For: jBPM 4.x
It is possible to specify the factory name to be used by JBPM when using the spring
integration via springhelper.
This is done via:
{code:title=jbpm.tx.spring.cfg.xml}
<transaction-context>
<transaction type="spring" />
<hibernate-session current="true"
factory="sessionFactory"/>
</transaction-context>
{code}
However when the processengine is constructed, this name is not used, and a type search
in the application context is done instead:
{code:title=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...
//...
}
{code}
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:
{code}
Multiple beans for type class org.springframework.orm.hibernate3.LocalSessionFactoryBean
found. Returning the first result.
{code}
SpringProcessEngine should used the name in the XML, or (less desirable) use a
spring-supplied name (via springhelper property?).
--
This message is automatically generated by JIRA.
-
For more information on JIRA, see: