다음을 통해 공유


VariableDispenser.LockOneForWrite Method

Puts the variable in a list, and then locks it for read/write access.

네임스페이스: Microsoft.SqlServer.Dts.Runtime
어셈블리: Microsoft.SqlServer.ManagedDTS (in microsoft.sqlserver.manageddts.dll)

구문

‘선언
Public Sub LockOneForWrite ( _
    variable As String, _
    ByRef variables As Variables _
)
public void LockOneForWrite (
    string variable,
    ref Variables variables
)
public:
void LockOneForWrite (
    String^ variable, 
    Variables^% variables
)
public void LockOneForWrite (
    String variable, 
    /** @ref */ Variables variables
)
JScript는 값 유형 인수를 참조로 전달하는 것을 지원하지 않습니다.

매개 변수

  • variable
    The name of the variable to lock for read/write access.
  • variables
    The name of the variables collection to put the requested variable into.

주의

This method combines the work of the LockForWrite method and the GetVariables method in one call, as it applies to a single variable only.

If the call succeeds, the requested variable is returned as a one-entry collection in the variable collection specified by the parameter variables, and the variable is locked for read/write access. To unlock the variable, release the variable collection using the Unlock method of the Variables class. If the LockOneForWrite method call fails, the variable is not locked.

Calls to this method do not affect the lock list generated by calls to LockForWrite.

[!참고] It is recommended that you do not make multiple calls to this method when acquiring locks for variables to be used together because this could lead to deadlocks. All variables being used together should be requested and locked together by calling the methods LockForRead or LockForWrite, followed by a call to the GetVariables.

If a lock was successful, you can clear it by calling Unlock.

스레드 보안

Any public static (Shared in Microsoft Visual Basic) members of this type are thread safe. Any instance members are not guaranteed to be thread safe.

플랫폼

개발 플랫폼

지원되는 플랫폼 목록은 SQL Server 2005 설치를 위한 하드웨어 및 소프트웨어 요구 사항을 참조하십시오.

대상 플랫폼

지원되는 플랫폼 목록은 SQL Server 2005 설치를 위한 하드웨어 및 소프트웨어 요구 사항을 참조하십시오.

참고 항목

참조

VariableDispenser Class
VariableDispenser Members
Microsoft.SqlServer.Dts.Runtime Namespace