This week's book giveaway is in the OO, Patterns, UML and Refactoring forum.
We're giving away four copies of Refactoring for Software Design Smells: Managing Technical Debt and have Girish Suryanarayana, Ganesh Samarthyam & Tushar Sharma on-line!
See this thread for details.
The moose likes JDBC and Relational Databases and the fly likes How to handle parallel or concurrent updates Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login

JavaRanch » Java Forums » Databases » JDBC and Relational Databases
Bookmark "How to handle parallel or concurrent updates" Watch "How to handle parallel or concurrent updates" New topic

How to handle parallel or concurrent updates

sourabh jaiswal

Joined: Jun 25, 2006
Posts: 6

I am doing concurrent updates on same table with java.

I have 2 cron jobs set in linux. Requirement is to execute them at same time. Both cron jobs run java code(JDBC) to update same table. I would like to know how can I perform this without hitting performance and locking table.
I am updating 50000 to 2lakh rows.

The database I am using is DB2.

Jeanne Boyarsky
author & internet detective

Joined: May 26, 2003
Posts: 32481

You'll need to elaborate more on the requirement. How big is the table? Do the cron jobs do the exact same thing or do they access different rows? What kind of update query is it? What database are you using?

[OCA 8 book] [Blog] [JavaRanch FAQ] [How To Ask Questions The Smart Way] [Book Promos]
Other Certs: SCEA Part 1, Part 2 & 3, Core Spring 3, TOGAF part 1 and part 2
It is sorta covered in the JavaRanch Style Guide.
subject: How to handle parallel or concurrent updates
It's not a secret anymore!