0

My requirement is I have to commit 4Million records to Oracle DB.

For that, I have developed a Java program which starts 10 threads. It's a producer and consumer design. Producer pushes data(Range. Ex. 1-1000) for every consumer (Java Thread). Consumers​ consumes the data and commits that range from one table to another table from Different DBs.

In consumer whenever thread commits data to DB I am logging the range and total no of records committed.

Everything is running smoothly, but after few minutes on console, it's logged that committed records as 90,000 but when I check in DB count is just 40,000.

Even Java program committed data but in Oracle DB why count is less?

After that I came to know multiple commits slow down the process. I am using proper connection pooling and batch processing.

I cannot create DB Link, or can't use another approach for this task. I have to use any Java technology. Normal JDBC , Hibernate or any other technology.

Please help me in resolving this issue.

Your time will be highly appreciated. Thanks.

Abdul
  • 1,130
  • 4
  • 29
  • 65
  • You have to add the piece of java code that deals with your transaction. No one can guess that what is wrong with it without seeing it. – Rohit Gaikwad Oct 28 '17 at 07:18
  • Instead of writing your own code, have you read about Oracle's bulk insert options? See here: https://stackoverflow.com/questions/987013/bulk-insert-into-oracle-database-which-is-better-for-cursor-loop-or-a-simple-s – Tim Biegeleisen Oct 28 '17 at 07:20
  • Please note that I copying data from AS400 to Oracle DB. I have to read data from AS400 data using Java program and then commit to Oracle DB. – Abdul Oct 28 '17 at 07:27
  • @Rohit -- Give me some time, I will add the code. I am using. I think then one of you will be able to help. – Abdul Oct 28 '17 at 08:38

0 Answers0