This week's book giveaway is in the Agile forum.
We're giving away four copies of Head First Agile and have Andrew Stellman & Jennifer Greene on-line!
See this thread for details.
Win a copy of Head First Agile this week in the Agile forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

Multiple threads causing duplicate records in database  RSS feed

 
karthik bhaskaran
Greenhorn
Posts: 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 16
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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.
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!