Win a copy of Mesos in Action this week in the Cloud/Virtualizaton forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Multiple records entered in DB

 
Sid Scud
Ranch Hand
Posts: 32
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
When the Submit button is clicked more than once in rapid succession, multiple records are entered in DB.
The Jsp page calls a method from a worker bean that inserts the record. I tried isThreadSafe="false" but it didn't work. I tried synchronizing the insert method too ... but it failed.
How can this be avoided?
 
Pranit Saha
Ranch Hand
Posts: 130
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,
u can check it whether the data u r inserting id thr in database or not..
like
if(rs.next())
{
//enter data
}
else
{
//Don't
}
u can do this ny referencing id field..
Pranit..
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic