Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

Increments the lock count for a MUMPS global. Note that MUMPS locks are advisory, meaning that MUMPS will not enforce locking automatically. It is the responsibility of your application code to check for and honor any outstanding locks before setting a MUMPS global.

Arguments

ArgumentData TypeRequiredDefaultDescription
globalNamestringYes-The name of the global to
examine
lock
subscriptsarrayYes-An array of subscripts
timeoutnumericNo0Number of seconds after which the lock attempt will fail

 Return Value

mumps.lock() returns true if the lock was successfully acquired.

Example

Code Block
languagecoldfusion
titleCFML
linenumberstrue
<cfset mumps = createObject("component", "lib.cfmumps.mumps").open()>
<!--- lock ^patients("WILLIS, JOHN","DOB") --->
<cfif mumps.lock("patients", ["WILLIS, JOHN", "DOB"])>
<cfset mumps.set("patients", ["WILLIS, JOHN", "DOB"], "12/1/1980")>
<cfset mumps.unlock("patients", ["WILLIS, JOHN", "DOB"])>
<cfelse>
<p>Lock failed.</p>
</cfif>
<cfset mumps.close()>

...