Subject | Use a row only once |
---|---|
Author | Chad Z. Hower aka Kudzu |
Post date | 2004-11-24T01:41:20Z |
I have a table which has "Items". Lets call it Item. Items can be linked to
a "Destination" by the use of foreign key in the Item table. When I match
them up, I need to find an item in the Item table with DestinationID that is
null. Then assign it to point to a row Destination table.
No problem - but concurrency. How can I "claim" the row in Item so that
another concurrent transaction will "grab" the next one? I have a unique
constraint on the FK, is the only way to try to post and see if the unique
constraint is triggerred?
a "Destination" by the use of foreign key in the Item table. When I match
them up, I need to find an item in the Item table with DestinationID that is
null. Then assign it to point to a row Destination table.
No problem - but concurrency. How can I "claim" the row in Item so that
another concurrent transaction will "grab" the next one? I have a unique
constraint on the FK, is the only way to try to post and see if the unique
constraint is triggerred?