wood burning stoves 2.0*
The moose likes BEA/Weblogic and the fly likes Multiple threads causing duplicate records in database Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Android Security Essentials Live Lessons this week in the Android forum!
JavaRanch » Java Forums » Products » BEA/Weblogic
Bookmark "Multiple threads causing duplicate records in database" Watch "Multiple threads causing duplicate records in database" New topic
Author

Multiple threads causing duplicate records in database

karthik bhaskaran
Greenhorn

Joined: Jul 23, 2013
Posts: 1
Hi All,

We have a web service deployed on weblogic 10.3 running in clustered mode with 4 nodes in the cluster, which inserts data into oracle database. At times, when there are multiple same requests coming in at the same time, we see duplicate records getting inserted into database table. On applying synchronized keyword at the method level, it still inserts duplicate records (as the synchronized code does not work in application deployed in clustered environment).

Can anyone help me out with a possible approach ?

Thanks
Karthik
Abhinav Sonkar
Greenhorn

Joined: Nov 20, 2013
Posts: 16
karthik bhaskaran wrote:At times, when there are multiple same requests coming in at the same time, we see duplicate records getting inserted into database table.


Why would you be getting multiple same requests? Wouldn't each request have its own ID? You can put a constraint on the database table to ensure duplicate records are not inserted.
 
It is sorta covered in the JavaRanch Style Guide.
 
subject: Multiple threads causing duplicate records in database
 
Similar Threads
Multiple Instance of App server- threading issue
Multiple Instance of App server- threading issue
Is it possible or not?
unit testing applications best practices.
Concurrent execution in clustered environment.