• <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 隔离级别

        Spring Batch ORA-08177: can#39;t serialize access for this transaction when running single job, SERIALIZED isolation level(Spring Batch ORA-08177:运行单个作业时无法序列化此事务的访问,SERIALIZED 隔离级别)
            <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 隔离级别的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持跟版网!

                  本站部分内容来源互联网,如果有图片或者内容侵犯了您的权益,请联系我们,我们会在确认后第一时间进行删除!

                  相关文档推荐

                  Oracle PL/SQL - Raise User-Defined Exception With Custom SQLERRM(Oracle PL/SQL - 使用自定义 SQLERRM 引发用户定义的异常)
                  Oracle: is there a tool to trace queries, like Profiler for sql server?(Oracle:是否有跟踪查询的工具,例如用于 sql server 的 Profiler?)
                  SELECT INTO using Oracle(使用 Oracle SELECT INTO)
                  How to handle Day Light Saving in Oracle database(如何在 Oracle 数据库中处理夏令时)
                  PL/SQL - Use quot;Listquot; Variable in Where In Clause(PL/SQL - 使用“列表Where In 子句中的变量)
                  Oracle: Import CSV file(Oracle:导入 CSV 文件)

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

                          <tbody id='z7UYh'></tbody>
                        <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>
                      • <small id='z7UYh'></small><noframes id='z7UYh'>

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