-
Hello,
If two sessions execute the following procedure at the same micro-second, will one of them be "willing to wait"? If not, how does one code a willing-to-wait lock?
CREATE OR REPLACE PROCEDURE
get_next_number_reference (IN_requested_type in out char, OUT_result_out in out number) AS
--
CURSOR c1 IS
SELECT big_sequence_nbr + 1
FROM number_reference
WHERE record_id = IN_requested_type FOR UPDATE;
BEGIN
OPEN C1;
FETCH C1 INTO OUT_result_out;
UPDATE number_reference
SET big_sequence_nbr = OUT_result_out
WHERE CURRENT OF c1;
CLOSE c1;
COMMIT;
END get_next_number_number;
We originally did not go with sequences because of advanced replication (but we have worked that out).
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|