Files
spring-batch/spring-batch-samples/src/main/resources/alt-data-source-context.xml
dsyer c022df6ce0 RESOLVED - issue BATCH-262: Hibernate Job blocks on flush
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.
2007-12-22 09:40:59 +00:00

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>