Forum OpenACS Q&A: double-click protection (was duplicate key problem creating new users)

If the object_id is generated by the page that is doing the insert, we may as well let __new generate it. And as far as wasting object_ids goes, I'd think that's really a non-problem.

The reason for pre-allocating the object_id is to nicely handle the "clicked submit twice" case, but the standard ACS technique of silently ignoring the second insertion with any particular object_id does break down with users web-savvy enough to use the back button (which barely even counts as "web-savvy" these days).

Strictly speaking, if we're going to do double-click protection by silently ignoring duplicate inserts, we should make sure that it really is a duplicate insert. Likewise, you don't want to just go and generate a new object if you have a collision, otherwise the double-click protection goes away and you end up with many duplicate items created by people who habitually double-click on things.

Thanks, gurus, for responding to this issue.  Personally I think this should be logged as a bug, even though, judging from the discussion, it has historically and slightly perversely been considered a feature.