• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

How to deal with single Erros IN batch updates in JDBC applications

 
Paulo Cesar Dias Lima
Greenhorn
Posts: 12
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I need to process only erros commands in my batch updates according
some numbers of tries.

I'm using PreparedStatement and addBatch to compose batchs commands.

After executeBatch() do executes and receiving results in int[].

Instead of catch BatchUpdateException for the batch commands how to catch only the single error statements ?

Thanks,

Paulo Lima.
 
Jeanne Boyarsky
author & internet detective
Marshal
Posts: 35279
384
Eclipse IDE Java VI Editor
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Paulo Cesar Dias Lima wrote:Instead of catch BatchUpdateException for the batch commands how to catch only the single error statements ?

Run them one at a time? The batch update is integrated. I don't think you can tease it apart like that.
 
Paulo Cesar Dias Lima
Greenhorn
Posts: 12
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Jeanne, correct I runned them once a time.

I agree that batch update is integrated so no way to catch individually commands error.

I'm trying to change my Persistence Tier to instead of use JDBC refactory to Stored Procedure that will result the number of rows on Insert/Update/Delete (CRUD) and also using a Queue process like Oracle Advanced Queuing (AQ) to notifies Erros to subscribers Java process.

I have to process a huge amount off request and very short ansewers time!

What do you think about this approach ?

Bill, do you think that using Queuing to catch/notify Huge amount of SQL commands it's a good option ?

I'm not sure if there is a SQL Patterns indicated to this scenario.

Thanks!

Paulo Lima.




 
Jeanne Boyarsky
author & internet detective
Marshal
Posts: 35279
384
Eclipse IDE Java VI Editor
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Paulo,
A sotred procedure cuts down on the netowrk traffic so it will help some.

I don't see how a queue helps you though. Once you introduce the queue, you are no longer updating in a single transaction. And if you don't need a single transaction, that opens the door to other batching techniques - like threading.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic