我收到此异常
PreparedStatementCallback; SQL [INSERT into BATCH_JOB_INSTANCE(JOB_INSTANCE_ID,JOB_NAME,JOB_KEY,VERSION)值(?,?,?,?)]; ORA-08177:无法序列化此交易的访问权限;嵌套异常是java.sql.SQLException:ORA-08177:无法序列化此事务的访问权限
单个批处理作业一次运行,并且在创建作业时没有发生其他事务我只在前一个作业被处理时才开始新的作业。
对于Ex。如果有20个文件,那么我将使用相同的JobLauncher为每个文件启动新Job,并更改JobParameters。但同时处理我得到一些文件的例外(这意味着JOB)
jobExecution = jobLauncher.run(job,jobParameters);
JobLauncher默认是同步的,因此它会等待作业完成
在for循环中,我通过提供不同的文件名来更改作业参数,以便它可以逐个顺序执行。
每次我跑步时,很少有工作失败。 解决办法是什么 ?我不想更改隔离级别for for create =" SERIALIZABLE"如READ_COMMITTED或其他
由于
<?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:batch="http://www.springframework.org/schema/batch"
xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-3.0.xsd
http://www.springframework.org/schema/batch http://www.springframework.org/schema/batch/spring-batch-2.1.xsd">
<bean id="transactionManager"
class="org.springframework.jdbc.datasource.DataSourceTransactionManager" >
<property name="dataSource" ref="dataSource" />
</bean>
<batch:job-repository id="jobRepository"
data-source="dataSource"
transaction-manager="transactionManager"
isolation-level-for-create="SERIALIZABLE"
/>
<bean id="jobLauncher"
class="org.springframework.batch.core.launch.support.SimpleJobLauncher">
<property name="jobRepository" ref="jobRepository" />
</bean>
<bean id="jobOperator" class="org.springframework.batch.core.launch.support.SimpleJobOperator">
<property name="jobExplorer">
<bean class="org.springframework.batch.core.explore.support.JobExplorerFactoryBean">
<property name="dataSource" ref="dataSource" />
</bean>
</property>
<property name="jobRepository" ref="jobRepository" />
<property name="jobRegistry" ref="jobRegistry" />
<property name="jobLauncher" ref="jobLauncher">
</property>
</bean>
<bean id="jobRegistry" class="org.springframework.batch.core.configuration.support.MapJobRegistry" />
<bean id="jobRegistryBeanPostProcessor" class="org.springframework.batch.core.configuration.support.JobRegistryBeanPostProcessor">
<property name="jobRegistry" ref="jobRegistry"/>
</bean>