简体   繁体   English

spring批量插入oracle数据库问题

[英]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.我有一个 spring 批处理示例,我从平面文件读取并写入 Oracle 数据库。 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 .当我第一次使用 Oracle 开发人员创建 oracle 表时,该示例工作正常,但是当我删除所有记录并运行 spring 批处理示例时,应用程序保持运行模式(在插入表时停止)并没有完成直到我手动(使用 oracle SQL Developer)在表中添加一条记录,这样它才能继续运行并完美完成。 Is that have a problem with the table that I'm using in oracle (I m not an expert in oracle database).我在 oracle 中使用的表有问题吗(我不是 oracle 数据库方面的专家)。 any help or suggestion please?请问有什么帮助或建议吗?

When you run the spring batch from the application, are you committing your changes?当您从应用程序运行 spring 批处理时,您是否正在提交更改? When you are doing large batch operations in Oracle, the database will place a lock on the table until the transaction is either committed or rolled back .当您在 Oracle 中进行大批量操作时,数据库将锁定表,直到事务committedrolled back If you are not doing that when you run your batch from within the application, my guess is that whatever you're doing from the application side is placing a lock on the table, and said lock is not removed until you manually commit your changes by adding a record to the table.如果您在应用程序中运行批处理时没有这样做,我的猜测是,无论您从应用程序端做什么,都会在表上放置一个锁,并且在您手动commit更改之前,不会删除所述锁向表中添加一条记录。 Try adding a commit point at the end of your application process to test.尝试在应用程序流程结束时添加一个commit点进行测试。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM