Win a copy of Practice Tests for OCP Java 17 Certification Exam (1Z0-829) this week in the OCPJP forum!
  • 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:
  • Tim Cooke
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Liutauras Vilda
Sheriffs:
  • Rob Spoor
  • Junilu Lacar
  • paul wheaton
Saloon Keepers:
  • Stephan van Hulst
  • Tim Moores
  • Tim Holloway
  • Carey Brown
  • Scott Selikoff
Bartenders:
  • Piet Souris
  • Jj Roberts
  • fred rosenberger

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: 4323
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
 
Consider Paul's rocket mass heater.
reply
    Bookmark Topic Watch Topic
  • New Topic