Hi there
Wouldn't it make sense to use a BasicDataSource instead of
DriverManagerDataSource as it is also recommended from Spring:
http://docs.spring.io/spring/docs/current/spring-framework-reference/html/jdbc.html#jdbc-connections
Instead of this:
<bean id="localDataSource"
class="org.springframework.jdbc.datasource.IsolationLevelDataSourceAdapter">
<property name="targetDataSource">
<bean class="org.springframework.jdbc.datasource.DriverManagerDataSource">
<property name="driverClassName" value="${jpa.driverClassName}"/>
<property name="url" value="${jpa.url}"/>
<property name="username" value="${jpa.username}"/>
<property name="password" value="${jpa.password}"/>
</bean>
</property>
<property name="isolationLevelName" value="ISOLATION_READ_COMMITTED"/>
</bean>
we can configure this bean:
<bean id="localDataSource"
class="org.springframework.jdbc.datasource.IsolationLevelDataSourceAdapter">
<property name="targetDataSource">
<bean class="org.apache.commons.dbcp.BasicDataSource"
destroy-method="close">
<property name="driverClassName" value="${jpa.driverClassName}"/>
<property name="url" value="${jpa.url}"/>
<property name="username" value="${jpa.username}"/>
<property name="password" value="${jpa.password}"/>
</bean>
</property>
<property name="isolationLevelName" value="ISOLATION_READ_COMMITTED"/>
</bean>
Thanks
Oli