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.
This commit is contained in:
@@ -1,24 +1,25 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<beans xmlns="http://www.springframework.org/schema/beans"
|
||||
<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">
|
||||
|
||||
<!-- Initialise the database before every test case: -->
|
||||
<import resource="data-source-context-init.xml"/>
|
||||
<!-- Initialise the database before every test case: -->
|
||||
<import resource="data-source-context-init.xml" />
|
||||
|
||||
<bean id="dataSource" class="org.springframework.jdbc.datasource.DriverManagerDataSource">
|
||||
<bean id="dataSource"
|
||||
class="org.springframework.jdbc.datasource.DriverManagerDataSource">
|
||||
<property name="driverClassName" value="${batch.jdbc.driver}" />
|
||||
<property name="url" value="${batch.jdbc.url}" />
|
||||
<property name="username" value="${batch.jdbc.user}" />
|
||||
<property name="password" value="${batch.jdbc.password}" />
|
||||
</bean>
|
||||
</bean>
|
||||
|
||||
<bean id="sessionFactory"
|
||||
class="org.springframework.orm.hibernate3.LocalSessionFactoryBean">
|
||||
<property name="dataSource" ref="dataSource" />
|
||||
<property name="mappingLocations" value="classpath*:/*.hbm.xml"/>
|
||||
<property name="mappingLocations" value="classpath*:/*.hbm.xml" />
|
||||
<property name="hibernateProperties">
|
||||
<value>
|
||||
<![CDATA[
|
||||
@@ -29,30 +30,37 @@
|
||||
</property>
|
||||
</bean>
|
||||
|
||||
<bean id="transactionManager" class="org.springframework.orm.hibernate3.HibernateTransactionManager" lazy-init="true">
|
||||
<bean id="transactionManager"
|
||||
class="org.springframework.orm.hibernate3.HibernateTransactionManager"
|
||||
lazy-init="true">
|
||||
<property name="sessionFactory" ref="sessionFactory" />
|
||||
</bean>
|
||||
|
||||
<!-- Use this to set additional properties on beans at run time -->
|
||||
<bean class="org.springframework.beans.factory.config.PropertyOverrideConfigurer">
|
||||
<bean
|
||||
class="org.springframework.beans.factory.config.PropertyOverrideConfigurer">
|
||||
<property name="location" value="classpath:batch.properties" />
|
||||
<!-- Allow system properties (-D) to override those from file -->
|
||||
<property name="localOverride" value="true"/>
|
||||
<property name="localOverride" value="true" />
|
||||
<property name="properties">
|
||||
<bean class="java.lang.System" factory-method="getProperties"/>
|
||||
<bean class="java.lang.System"
|
||||
factory-method="getProperties" />
|
||||
</property>
|
||||
<property name="ignoreInvalidKeys" value="true" />
|
||||
<property name="order" value="2"/>
|
||||
<property name="order" value="2" />
|
||||
</bean>
|
||||
|
||||
<bean class="org.springframework.beans.factory.config.PropertyPlaceholderConfigurer">
|
||||
<bean
|
||||
class="org.springframework.beans.factory.config.PropertyPlaceholderConfigurer">
|
||||
<property name="location" value="classpath:batch.properties" />
|
||||
<property name="systemPropertiesModeName" value="SYSTEM_PROPERTIES_MODE_OVERRIDE"/>
|
||||
<property name="systemPropertiesModeName"
|
||||
value="SYSTEM_PROPERTIES_MODE_OVERRIDE" />
|
||||
<property name="ignoreUnresolvablePlaceholders" value="false" />
|
||||
<property name="order" value="1"/>
|
||||
<property name="order" value="1" />
|
||||
</bean>
|
||||
|
||||
<bean id="incrementerParent" class="${batch.database.incrementer.class}" abstract="true">
|
||||
<bean id="incrementerParent"
|
||||
class="${batch.database.incrementer.class}" abstract="true">
|
||||
<property name="dataSource" ref="dataSource" />
|
||||
</bean>
|
||||
|
||||
@@ -61,7 +69,8 @@
|
||||
</bean>
|
||||
|
||||
<bean id="jobExecutionIncrementer" parent="incrementerParent">
|
||||
<property name="incrementerName" value="BATCH_JOB_EXECUTION_SEQ" />
|
||||
<property name="incrementerName"
|
||||
value="BATCH_JOB_EXECUTION_SEQ" />
|
||||
</bean>
|
||||
|
||||
<bean id="stepIncrementer" parent="incrementerParent">
|
||||
@@ -69,17 +78,20 @@
|
||||
</bean>
|
||||
|
||||
<bean id="stepExecutionIncrementer" parent="incrementerParent">
|
||||
<property name="incrementerName" value="BATCH_STEP_EXECUTION_SEQ" />
|
||||
<property name="incrementerName"
|
||||
value="BATCH_STEP_EXECUTION_SEQ" />
|
||||
</bean>
|
||||
|
||||
<bean id="partitionIncrementer" parent="incrementerParent">
|
||||
<property name="incrementerName" value="BATCH_PARTITION_SEQ" />
|
||||
</bean>
|
||||
|
||||
<bean id="partitionInstanceIncrementer" parent="incrementerParent">
|
||||
<property name="incrementerName" value="BATCH_PARTITION_EXECUTION_SEQ" />
|
||||
<bean id="partitionInstanceIncrementer"
|
||||
parent="incrementerParent">
|
||||
<property name="incrementerName"
|
||||
value="BATCH_PARTITION_EXECUTION_SEQ" />
|
||||
</bean>
|
||||
|
||||
<!-- import resource="alt-data-source-context.xml" /-->
|
||||
<!--import resource="alt-data-source-context.xml" /-->
|
||||
|
||||
</beans>
|
||||
Reference in New Issue
Block a user