How to avoid 2 users editing same record

admin

Administrator
Staff member
I can't find the answer to this puzzle. To make sure two users don't get an "edit" screen for a record, I check the status of a record. If it is "open", I grab a sequence number and place it in the field indicating the record is being edited. That way another user won't be able to edit the record. What if 2 requests are checking the status at the same time and get "open", then both grab a sequence number and update the status? It will be a problem unless checking the status, grabbing a sequence number, and putting that sequence number in the status field can be done in a single step. Is there a sql statement for this? How is this common workflow situation handled?

Thanks,
Brad Czika
WorldCom (formerly UUNET)
Sales Engineering
Web Developer / Oracle DBA
 
Back
Top