• <tfoot id='daoKm'></tfoot>
    • <bdo id='daoKm'></bdo><ul id='daoKm'></ul>
  • <legend id='daoKm'><style id='daoKm'><dir id='daoKm'><q id='daoKm'></q></dir></style></legend>

      <i id='daoKm'><tr id='daoKm'><dt id='daoKm'><q id='daoKm'><span id='daoKm'><b id='daoKm'><form id='daoKm'><ins id='daoKm'></ins><ul id='daoKm'></ul><sub id='daoKm'></sub></form><legend id='daoKm'></legend><bdo id='daoKm'><pre id='daoKm'><center id='daoKm'></center></pre></bdo></b><th id='daoKm'></th></span></q></dt></tr></i><div id='daoKm'><tfoot id='daoKm'></tfoot><dl id='daoKm'><fieldset id='daoKm'></fieldset></dl></div>

      1. <small id='daoKm'></small><noframes id='daoKm'>

      2. Spring Batch ORA-08177:运行单个作业时无法序列化此事务的访问,SERIALIZED 隔离级别

        时间:2023-09-18
            <tbody id='jq1GV'></tbody>
              <bdo id='jq1GV'></bdo><ul id='jq1GV'></ul>
              <legend id='jq1GV'><style id='jq1GV'><dir id='jq1GV'><q id='jq1GV'></q></dir></style></legend>
              1. <tfoot id='jq1GV'></tfoot>

              2. <i id='jq1GV'><tr id='jq1GV'><dt id='jq1GV'><q id='jq1GV'><span id='jq1GV'><b id='jq1GV'><form id='jq1GV'><ins id='jq1GV'></ins><ul id='jq1GV'></ul><sub id='jq1GV'></sub></form><legend id='jq1GV'></legend><bdo id='jq1GV'><pre id='jq1GV'><center id='jq1GV'></center></pre></bdo></b><th id='jq1GV'></th></span></q></dt></tr></i><div id='jq1GV'><tfoot id='jq1GV'></tfoot><dl id='jq1GV'><fieldset id='jq1GV'></fieldset></dl></div>

                <small id='jq1GV'></small><noframes id='jq1GV'>

                  本文介绍了Spring Batch ORA-08177:运行单个作业时无法序列化此事务的访问,SERIALIZED 隔离级别的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着跟版网的小编来一起学习吧!

                  问题描述

                  我在 Spring Batch 中的 JobRepository 上使用 SERIALIZED 隔离级别收到此异常:

                  I am getting this exception with SERIALIZED isolation level on JobRepository in Spring Batch:

                  org.springframework.dao.CannotSerializeTransactionException: PreparedStatementCallback; SQL [INSERT into DATAFEED_APP.BATCH_JOB_INSTANCE(JOB_INSTANCE_ID, JOB_NAME, JOB_KEY, VERSION) values (?, ?, ?, ?)]; ORA-08177: can't serialize access for this transaction
                  

                  ;嵌套异常是 java.sql.SQLException: ORA-08177: can't serialize access for this transaction

                  ; nested exception is java.sql.SQLException: ORA-08177: can't serialize access for this transaction

                  at org.springframework.jdbc.support.SQLErrorCodeSQLExceptionTranslator.doTranslate(SQLErrorCodeSQLExceptionTranslator.java:269)
                  at org.springframework.jdbc.support.AbstractFallbackSQLExceptionTranslator.translate(AbstractFallbackSQLExceptionTranslator.java:72)
                  at org.springframework.jdbc.core.JdbcTemplate.execute(JdbcTemplate.java:603)
                  at org.springframework.jdbc.core.JdbcTemplate.update(JdbcTemplate.java:812)
                  at org.springframework.jdbc.core.JdbcTemplate.update(JdbcTemplate.java:868)
                  at org.springframework.jdbc.core.JdbcTemplate.update(JdbcTemplate.java:872)
                  at org.springframework.batch.core.repository.dao.JdbcJobInstanceDao.createJobInstance(JdbcJobInstanceDao.java:105)
                  at org.springframework.batch.core.repository.support.SimpleJobRepository.createJobExecution(SimpleJobRepository.java:135)
                  at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
                  at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
                  at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
                  at java.lang.reflect.Method.invoke(Method.java:597)
                  at org.springframework.aop.support.AopUtils.invokeJoinpointUsingReflection(AopUtils.java:317)
                  at org.springframework.aop.framework.ReflectiveMethodInvocation.invokeJoinpoint(ReflectiveMethodInvocation.java:183)
                  at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:150)
                  at org.springframework.transaction.interceptor.TransactionInterceptor.invoke(TransactionInterceptor.java:110)
                  at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:172)
                  at org.springframework.batch.core.repository.support.AbstractJobRepositoryFactoryBean$1.invoke(AbstractJobRepositoryFactoryBean.java:172)
                  at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:172)
                  at org.springframework.aop.framework.JdkDynamicAopProxy.invoke(JdkDynamicAopProxy.java:204)
                  at $Proxy27.createJobExecution(Unknown Source)
                  at org.springframework.batch.core.launch.support.SimpleJobLauncher.run(SimpleJobLauncher.java:124)
                  at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
                  at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
                  at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
                  at java.lang.reflect.Method.invoke(Method.java:597)
                  at org.springframework.aop.support.AopUtils.invokeJoinpointUsingReflection(AopUtils.java:317)
                  at org.springframework.aop.framework.ReflectiveMethodInvocation.invokeJoinpoint(ReflectiveMethodInvocation.java:183)
                  at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:150)
                  at org.springframework.batch.core.configuration.annotation.SimpleBatchConfiguration$PassthruAdvice.invoke(SimpleBatchConfiguration.java:117)
                  at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:172)
                  at org.springframework.aop.framework.JdkDynamicAopProxy.invoke(JdkDynamicAopProxy.java:204)
                  at $Proxy61.run(Unknown Source)
                  

                  当只运行一项工作时,没有其他并行.当我将 JobRepository 的隔离级别更改为 ISOLATION_READ_COMMITTED 时,异常消失了.

                  when runing only one job, nothing else in parallel. When I change isolation level for JobRepository to ISOLATION_READ_COMMITTED the exception is gone.

                  这个异常的原因是什么?

                  What is the reason of this exception?

                  推荐答案

                  来自 official doc - 4.3.1

                  该方法的默认隔离级别是 SERIALIZABLE,即相当激进:READ_COMMITTED 也能正常工作;READ_UNCOMMITTED 如果两个进程不太可能以这种方式碰撞.但是,由于调用 create* 方法是很短,SERIALIZED 不太可能引起问题,只要数据库平台支持.

                  The default isolation level for that method is SERIALIZABLE, which is quite aggressive: READ_COMMITTED would work just as well; READ_UNCOMMITTED would be fine if two processes are not likely to collide in this way. However, since a call to the create* method is quite short, it is unlikely that the SERIALIZED will cause problems, as long as the database platform supports it.

                  这篇关于Spring Batch ORA-08177:运行单个作业时无法序列化此事务的访问,SERIALIZED 隔离级别的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持跟版网!

                  上一篇:如何在不使用 DESCRIBE 命令的情况下描述 Oracle 中的表? 下一篇:使用 PL/SQL 创建 Excel 文件 (.xlsx)

                  相关文章

                  1. <tfoot id='z7UYh'></tfoot>
                    <legend id='z7UYh'><style id='z7UYh'><dir id='z7UYh'><q id='z7UYh'></q></dir></style></legend>

                      <i id='z7UYh'><tr id='z7UYh'><dt id='z7UYh'><q id='z7UYh'><span id='z7UYh'><b id='z7UYh'><form id='z7UYh'><ins id='z7UYh'></ins><ul id='z7UYh'></ul><sub id='z7UYh'></sub></form><legend id='z7UYh'></legend><bdo id='z7UYh'><pre id='z7UYh'><center id='z7UYh'></center></pre></bdo></b><th id='z7UYh'></th></span></q></dt></tr></i><div id='z7UYh'><tfoot id='z7UYh'></tfoot><dl id='z7UYh'><fieldset id='z7UYh'></fieldset></dl></div>
                    1. <small id='z7UYh'></small><noframes id='z7UYh'>

                      • <bdo id='z7UYh'></bdo><ul id='z7UYh'></ul>