http://jira.springframework.org/browse/BATCH-262 The hibernate job blocks with high isolatio nlevels because it is reading a cursor and then updating the same objects (the cursor is in a different transaction because it uses openSession()). The resolution is to change the isolation level - might be worth some more careful work later to encourage the right sort of best practice.
26 lines
1.1 KiB
XML
26 lines
1.1 KiB
XML
<?xml version="1.0" encoding="UTF-8"?>
|
|
<beans xmlns="http://www.springframework.org/schema/beans"
|
|
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
|
xmlns:util="http://www.springframework.org/schema/util"
|
|
xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-2.0.xsd
|
|
http://www.springframework.org/schema/util http://www.springframework.org/schema/util/spring-util-2.0.xsd">
|
|
|
|
<bean id="dataSource"
|
|
class="org.springframework.jdbc.datasource.IsolationLevelDataSourceAdapter">
|
|
<property name="targetDataSource">
|
|
<bean
|
|
class="test.jdbc.datasource.DerbyDataSourceFactoryBean" />
|
|
</property>
|
|
<!-- Keep the isolation level low so that a cursor in an ItemReader will not lock the table -->
|
|
<property name="isolationLevelName"
|
|
value="ISOLATION_READ_COMMITTED" />
|
|
</bean>
|
|
|
|
<bean
|
|
class="org.springframework.beans.factory.config.PropertyPlaceholderConfigurer">
|
|
<property name="location" value="classpath:alt.properties" />
|
|
<property name="ignoreUnresolvablePlaceholders" value="false" />
|
|
<property name="order" value="0" />
|
|
</bean>
|
|
|
|
</beans> |