Solved

Getting multiple transaction postings

Posted on 1998-05-14
3
165 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
3 Comments
 
LVL 28

Accepted Solution

by:
sybe earned 70 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

DevOps Toolchain Recommendations

Read this Gartner Research Note and discover how your IT organization can automate and optimize DevOps processes using a toolchain architecture.

Question has a verified solution.

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

Introduction:   Welcome to my first article ever. To begin with, the reason I write this article.  I participated in a question on Experts Exchange about the start command in Windows and there were some discussion about the usage. The discussio…
This tutorial will discuss fancy secure registration forms, with AJAX technology support. In this article I assume you already know HTML and some JS. I will write the code using WhizBase Server Pages, so you need to know some basics in WBSP (you mig…
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…
This tutorial will teach you the core code needed to finalize the addition of a watermark to your image. The viewer will use a small PHP class to learn and create a watermark.

911 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

Need Help in Real-Time?

Connect with top rated Experts

23 Experts available now in Live!

Get 1:1 Help Now