• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

How to avoid duplicate submissions

 
Greenhorn
Posts: 5
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
How to avoid duplicate submissions (Purcahse orders etc) in JSP.

TIA
 
author
Posts: 4335
39
jQuery Eclipse IDE Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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 ]
 
Greenhorn
Posts: 2
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
 
Sheriff
Posts: 14691
16
Eclipse IDE VI Editor Ubuntu
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
 
Ranch Hand
Posts: 74
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
 
reply
    Bookmark Topic Watch Topic
  • New Topic