Want to win a PS4? Go Premium and enter to win our High-Tech Treats giveaway. Enter to Win

x
?
Solved

Getting multiple transaction postings

Posted on 1998-05-14
3
Medium Priority
?
171 Views
Last Modified: 2013-12-25
Processing a cgi form in PERL, I am finding duplications (2x & 3x)  of the same record
appearing in the database. Believe the user holds the key down too long or perhaps
presses the submit key multiple times. How can I prevent these multiple transactions?
I'm a novice in PERL & do not know the C language equivalent to flushall(); could that
be the problem?
0
Comment
Question by:lshaffer
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
3 Comments
 
LVL 28

Accepted Solution

by:
sybe earned 210 total points
ID: 1828535
I don't think you can prevent it completely. What happens is when a user clicks on submit, the form data are send to your server, which then calls your perlscript. The sending takes time, depending on the speed of the connection and the amount of data send.

Then the script starts processing the data, which also takes some time, and when it is finished it sends the respons to the user.

Depending on how much data there is in the form, this can take a while, and the user will keep on seeing the form. Being impatient he might hit the submit button again, and send the data again.

One option to speed up the respons to the user is to send a first respons at the start of the perlscript, so before processing the data. But this might not be enough to prevent the user to get impatient.

So there is probably nothing left to do but make it easy to remove double transactions from the database.

If you use other, client side ways to make the form disappear when the user submits the form (for example using javascript) you  might miss some of the forms submitted as the data are lost in cyberspace.










0
 
LVL 6

Expert Comment

by:alamo
ID: 1828536
Another possibility is that your form is using the GET method rather than the POST method to submit its data. A GET form will be resubmitted with no warning to the user when it is accessed via a bookmark, reloaded, or even sometimes by pressing the BACK button. A POST form will warn the user before resubmitting. The user could still resubmit it if they want, but that would be rare- resubmissions as you describe are usually accidental.
0
 

Author Comment

by:lshaffer
ID: 1828537
This may be a workable solution. Time will tell. Thanks
0

Featured Post

Free Tool: Port Scanner

Check which ports are open to the outside world. Helps make sure that your firewall rules are working as intended.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Making a simple AJAX shopping cart Couple years ago I made my first shopping cart, I used iframe and JavaScript, it was very good at that time, there were no sessions or AJAX, I used cookies on clients machine. Today we have more advanced techno…
This article is meant to give a basic understanding of how to use R Sweave as a way to merge LaTeX and R code seamlessly into one presentable document.
Learn the basics of strings in Python: declaration, operations, indices, and slicing. Strings are declared with quotations; for example: s = "string": Strings are immutable.: Strings may be concatenated or multiplied using the addition and multiplic…
Learn the basics of while and for loops in Python.  while loops are used for testing while, or until, a condition is met: The structure of a while loop is as follows:     while <condition>:         do something         repeate: The break statement m…
Suggested Courses

618 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question