Win a copy of Murach's Python Programming this week in the Jython/Python forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

How to avoid duplicate submissions  RSS feed

 
Joggari Reddy
Greenhorn
Posts: 5
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
How to avoid duplicate submissions (Purcahse orders etc) in JSP.

TIA
 
Scott Selikoff
author
Bartender
Posts: 4081
21
Eclipse IDE Flex Google Web Toolkit
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Before committing a transaction verify there is not an identical order placed by the same customer in the last 10-30 seconds. Its not very common users will be placing multiple orders within 10 seconds of each other.

As a side note locking will not normally help in situations like this (unless you lock the entire table or database ) since you cannot lock on items that do not exist such as a new purchase order.
[ January 04, 2006: Message edited by: Scott Selikoff ]
 
Ramesh Sukumar
Greenhorn
Posts: 2
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
In my opinion, this scenario can be better managed with a flag variable inthe session which can be initialised and reinitialised(say 'true')every time, when there is a change in the purhase order list. When the order is submitted, the variable can be verified for 'true' and then set to 'false'. So that when there is a duplicate submission, the variable will have 'false' and the duplicate submission can be avoided.

Hope this works out.

regards
 
Christophe Verré
Sheriff
Posts: 14691
16
Eclipse IDE Ubuntu VI Editor
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Somebody asked the same question a few days ago,
and a rancher told him the have a look there :
Double submit problem
 
Pavan Tummala
Ranch Hand
Posts: 74
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
2 ways :
--Add a javascript function which will disable the submit button upon first submit.
--Use back end logic using request header information, timestamps etc.. eg: tokens in struts
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!