dupe records on refresh

2

2obvious

Despite my best efforts, I cannot prevent bogus duplicate records in my
database. I have a routine that compares against similarities,
presenting an alert page with examples when there is a regular
expression match. It works brilliantly.

Get beyond this page, however, and anytime one submits, goes back in
history, and submits again, there is a duplicate. (Questioning why
someone would do this will not solve my problems--I'm just trying to
make things bulletproof.)

I can only think of two methods to solve my problem, neither of which
seems practical. I was hoping for some outside insight.

Method 1: kill the browser history, making it impossible for my users
to go back and resubmit. Due to security issues, the only way I know
of pulling this off is indirect and annoying: a pop-up.

Method 2: check every field of every record for an identical match each
time. This would probably slow the server to a crawl.

I'm using hidden form fields to pass data, if it helps. But I'm
storing them in a globally-used server side include. I did a brief
experiment with saving to a session variable and got the same results.
But I don't have any experience with session variables, so perhaps I
didn't try hard enough?
 
B

Bob Barrows [MVP]

2obvious said:
Despite my best efforts, I cannot prevent bogus duplicate records in
my database. I

Preventing duplicates is what your database's primary key and/or unique
index is for. It is folly to attempt to use application code to do your
database's job. Your database should be designed to protect your data's
integrity. Given that you're telling us that duplicates are being allowed, I
can pretty much guarantee that your database design is flawed.

Post some details and maybe somebody will have some suggestions.


Bob Barrows
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,756
Messages
2,569,540
Members
45,025
Latest member
KetoRushACVFitness

Latest Threads

Top