<p dir="auto"><strong><a href="https://jira.spring.io/secure/ViewProfile.jspa?name=costin" rel="nofollow">Costin Leau</a></strong> opened <strong><a href="https://jira.spring.io/browse/SPR-1633?redirect=false" rel="nofollow">SPR-1633</a></strong> and commented</p>
<p dir="auto">The current implementation of LocalSessionFactoryBean resets the config time data source before leaving afterPropertiesSet. However, other frameworks that use Hibernate namely jbpm will not find a datasource when trying to create the schema as they will unfortunately reinstantiates a ConnectionProvider which will reuse the datasource which will return null. The issue is similar with (<a href="http://opensource2.atlassian.com/projects/spring/browse/SPR-1547" rel="nofollow">http://opensource2.atlassian.com/projects/spring/browse/SPR-1547</a>) but the Spring-provided DataSource will be request during the HB sessionFactory life-time (between afterPropertiesSet and destroy).<br>
The javadoc mention that :</p>
<ul dir="auto">
<li>This instance will be set before initialization of the corresponding</li>
<li>SessionFactory, and reset immediately afterwards. It is thus only available</li>
<li>during configuration.<br>
What's the reason for that?</li>
</ul>
<p dir="auto">You can find more details about the issue occuring in JBPM here: <a href="http://opensource2.atlassian.com/projects/spring/browse/MOD-75" rel="nofollow">http://opensource2.atlassian.com/projects/spring/browse/MOD-75</a></p>
<hr>
<p dir="auto"><strong>Affects:</strong> 1.2.6</p>
<p dir="auto"><strong><a href="https://jira.spring.io/secure/ViewProfile.jspa?name=nebhale" rel="nofollow">nebhale</a></strong> opened <strong><a href="https://jira.spring.io/browse/SPR-1927?redirect=false" rel="nofollow">SPR-1927</a></strong> and commented</p>
<hr>
<p dir="auto"><strong>Affects:</strong> 2.0 M3</p>