Spring Batch ORA-08177: can't serialize access for this transaction when running single job, SERIALIZED isolation level

前端 未结 9 487
后悔当初
后悔当初 2020-12-01 07:58

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

org.springframework.dao.CannotSerializeTransactionException: Pr         


        
相关标签:
9条回答
  • 2020-12-01 08:49

    When using serialized transactions you need to increase the initrans parameter on the table per the Oracle Docs. To handle serialized transactions this needs to be 3 or more.

    alter table BATCH_.... INITRANS 3
    
    0 讨论(0)
  • 2020-12-01 08:50

    My case when there is something happen on the DB side, re-run have the same problem.

    To resolve I clean up all the table below and re-run seems fine after that.

    • BATCH_JOB_EXECUTION
    • BATCH_JOB_EXECUTION_CONTEXT
    • BATCH_JOB_EXECUTION_PARAMS
    • BATCH_JOB_INSTANCE
    • BATCH_STEP_EXECUTION
    • BATCH_STEP_EXECUTION_CONTEXT
    0 讨论(0)
  • 2020-12-01 08:56

    We have tried jacking up INI_TRANS to 100 and we were still running into issues

    I found this article that suggests adding ROWDEPENDENCIES to the creation of tables.

    http://www.devx.com/dbzone/Article/41591?pf=true

    For me with INI_TRANS & now ROWDEPENDENCIES the exceptions for Serialized have gone away.

    Update: Turns out not to be a perfect solution. We did have one event of this SERIALIZED exception happen over night. Now that's much better as we had 100s of runs before a single failure but it appears that using ROWDEPENDENCIES isn't a yet a complete solution.

    0 讨论(0)
提交回复
热议问题