Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chriss Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Lock vs NoLock

Status
Not open for further replies.

programmher

Programmer
May 25, 2000
235
US
Hello again from stored procedure land. I have now encountered some SPs that specifically use the "nolock" function.

My question is - do I have to reproduce this in my CF code? Do the tables affected by the process that occurs between CF and the SQL tables really need a no-locking function?
 
Hey programmher,

I may not be clear on what you're asking but for the most part, locking in a db server and locking in CF are separate issues. When issuing a lock in CF, you are basically forcing a code block to execute fully before someone else can run it. In a db server, the locking is related to processes the db server is aware of. This means that locking at the db server will protect against queries run from CF, from direct queries, and from operations from other systems/applications. If the db server locking has been set correctly inside the SP, you should be able to call this externally without any problems. If however the SP was written with the assumption that the calling application will do appropriate locking, then you will have to handle this in CF as well.

Hope this helps,
GJ
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top