Morphism
asked on
ADO - SQL Sever
Why do we need ADO locking if SQL Server uses its own locking system
It is wise to leave locking to SQL Server, it automatically calculates the locking level which should be used. You can use ADO sql execution to force a particular type of lock, but you'd better be careful.
ADO locking is there to provide you with feedback on the locking state in a multi-user system. If you use adLockOptimistic for every transaction then you may encounter problems updating a record that is locked by another user. adLockPessimistic raises an error if you attempt this and you can then deal with the failed update, retry or abandon it. SQL Server on its own will not do this for you unless you build it into the stored procedures that you call using ADO. In many ways this is a better option, that is using stored procedures and building in verification of updates/inserts and recovery. This would allow your application to run in the same manner using any data access technology.
ASKER
so I should really use stored procs instead of ADO executes or ADO Recorsets?
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
how do you mean the database layer should be independent
of the dataaccess layer
of the dataaccess layer