This question about Using an extension: Asked
Potential user conflict using set variable for Doc id in a topic
I am using the comment plugin together with the setvariableplugin to create a "reserve document id" form. The form is based on these tip Faq17
The form steps up a variable DOCID each time the user click OK in the form. However I see a problem during the following scenario:
Both user A and B have the same topic opened in their browsers. User A submit the form and the DOCID is stepped up by one. If then user B do the same without first doing a browser refresh, there will be a conflict where user B uses outdated topic data.
Does anyone know if there is a way to avoid this sceanrio?
- 22 Feb 2010
I raised this concern in the BestPracticeTip1
topic. I don't think there are any easy solutions (other than using the AUTOINC feature, which I assume you have good reasons to avoid).
The easiest fix would be to create a perl plugin, as it seems a common enough request.
The other option is to live with non-sequential DOCIDs, ie. base them off a time or hash function.
- 22 Feb 2010
Thanks for your suggestions.
With "The easiest fix would be to create a perl plugin
", do you mean creating a plugin for that particular feature...?
- 25 Feb 2010
Yes, I mean creating a perl plugin for this particular feature.
- Intercept the click on the save/submit button
- Fetch current DOCID from wiki
- Update the DOCID field in the form that we stopped from being submitted
- Return to normal flow (now the browser POSTs/saves the new topic with an up-to-date DOCID).
This still has a small window of opportunity for conflicts to arise, but hopefully the window is only a few seconds in between the query to get the latest DOCID and the save which saves the new/incremented DOCID. If anybody else is trying to create a new DOCID at the same time there could be a conflict.
If you are happy with non-sequential DOCIDs there's also PermLinkPlugin
- 03 Mar 2010
- 12 Mar 2010
Start putting the SEARCH and CALC stuff on an extra topic. Fetch this topic with params
This should output almost only your number without any skin stuff around.
- 13 Mar 2010