Forum OpenACS Development: Unique constraint violation after using back button
duplicate key value violates unique constraint "acs_objects_context_object_un"
I realize generating the object_id in advance is part of double click protection but is there a way to trigger a new request when the back button is used?
Firefox diverges from other browsers with the philosophy that the back button should display a page as it was originally requested.
For this reason the sequence does not increment and the unique constraint error occurs.
Has anyone encountered a solution for this?
Is the form dual purpose update/create? If so, it seems that the intent needs to be distinguished by choosing a different button (new or update) to allow the form processing to confirm if form is expected to create a new object or use existing reference.
If the form's purpose is just to create, then one could check the time signature between the last time the key_value was used and the current time. If the time is within a few seconds, then it's a doubclick.. handle appropriately (ignore etc), otherwise grab another key and post as new..