[Last Call] Learn how to a build a cloud-first strategyRegister Now

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 138
  • Last Modified:

Getting multiple transaction postings

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
lshaffer
Asked:
lshaffer
  • 2
1 Solution
 
fasterCommented:
The solution depends on your requirement.   Normally you should check whether to a record is OK before inserting it to the database, and normally your database should contain a key field, which means a duplicate record will not be allowed by the db engine.  What database you use?  Try to define a key field then the database will reject such insert automatcially.
0
 
GovindaCommented:
I agree with faster
0
 
lshafferAuthor Commented:
I'm in the same situation your database uses here. Notice even your database
allowed my record duplication. (Yes I double struck your sumitt key as a test) .              Not too cool for the experts!

(1). I'm receiving a text Change Request Submittal to a library publication by the user.      My database is "Basis" a powerful text DB. But the unique key is auto generated.

(2). Fix your system first then tell me me how?
0
 
fasterCommented:
Firstly, we so called experts are only normal user like you, I (and others replying your question does not have ANY relationship with this site, so I know nothing about the implementation of this site)

Secondly, I don't think the duplite is a big problem (if it can be called as a problem).  No one really cares whether a problem is duplicated, and there is no real good solution to prevent such problem.  The program can of course make the title as the key field, but this may not be desirable.

You must first think carefully for any of your table, can you allow duplicate field.  Give you an example, let's say hotmail.  The program must ensure that user id is unique, but user name, password etc. need not have this restriction.  If one really want to have several account, there is no way to prevent it.

This is why I said it depends on your requirement.
0

Featured Post

Upgrade your Question Security!

Add Premium security features to your question to ensure its privacy or anonymity. Learn more about your ability to control Question Security today.

  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now