首页 > 解决方案 > spring batch insert into oracle database issue

问题描述

I have a spring batch example where I read from a Flat file and write into Oracle database. when I create the oracle table the first time using Oracle developer , the example work perfect , but when I delete all the records and run the spring batch example the application stay in running mode (stop at the point wher insert in table) and not finish until I manually (using oracle SQL Developer ) add a record in the table , so it s continue running and complete perfectly . Is that have a problem with the table that I'm using in oracle (I m not an expert in oracle database). any help or suggestion please?

标签: oraclespring-batch

解决方案


当您从应用程序运行 spring 批处理时,您是否提交了更改?在 Oracle 中进行大批量操作时,数据库会对表进行锁定,直到事务为committedrolled back。如果您在从应用程序中运行批处理时没有这样做,我的猜测是,无论您在应用程序端做什么都是在表上放置一个锁,并且在commit您通过添加手动更改之前不会删除锁记录到表中。尝试commit在申请流程结束时添加一个点进行测试。


推荐阅读