Skip to content

Commit

Permalink
Incident #20102 - added FOR UPDATE clause to fetchnextnumber, prevent…
Browse files Browse the repository at this point in the history
…ing users from fetching the same number at the same time

git-svn-id: http://svn.code.sf.net/p/postbooks/code/xtupleserver/trunk@14629 ea1a15ef-c238-0410-93cb-fa28e9f07733
  • Loading branch information
mikeodonnell authored and mikeodonnell committed May 17, 2013
1 parent b2c088d commit 8ba15a9
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion dbscripts/functions/fetchnextnumber.sql
Expand Up @@ -17,7 +17,7 @@ BEGIN
SELECT CAST(orderseq_number AS text), orderseq_number, orderseq_table, orderseq_numcol, COALESCE(orderseq_seqiss, ARRAY[]::seqiss[])
INTO _number, _nextnum, _table, _numcol, __seqiss
FROM orderseq
WHERE (orderseq_name=psequence);
WHERE (orderseq_name=psequence) FOR UPDATE;

IF (NOT FOUND) THEN
RAISE EXCEPTION 'Invalid orderseq_name %', psequence;
Expand Down

0 comments on commit 8ba15a9

Please sign in to comment.