skimox
asked on
Record locking on classic ASP
I need to do record locking in classic ASP. I was able to get it working in ASP.NET using System.Transactions code on the same system that the classic ASP code is running. The problem is protecting (linearizing access to) the classic read-modify-write cycle on a single record in an SQL Server 2012 database table.
Conceptually I need to do the following simple steps:
lock_record()
select cur_value from value_tbl where id_val = 1;
next_value = cur_value + 1
update value_tbl set cur_value = next_value where id_val = 1;
unlock_record()
Conceptually I need to do the following simple steps:
lock_record()
select cur_value from value_tbl where id_val = 1;
next_value = cur_value + 1
update value_tbl set cur_value = next_value where id_val = 1;
unlock_record()
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
Thanks very much Steve, I got it working.
ASKER
I agree ASP.NET is much better than ASP but we have so much code written in ASP that converting it all to ASP.NET would be a huge project and is not feasible right now.
I did try to get ADO transactions to work in ASP but was unsuccessful. Are there some versions of SQL Server that don't support transactions? I know there are more expensive versions of SQL Server 2012 than what we have but I don't know how to check what version we have. Clicking "About" on the SSMS Help menu doesn't tell me.