다음을 통해 공유


VariableDispenser.LockOneForRead 메서드

Puts the variable in a list, and then locks it for read-only access.

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

구문

‘선언
Public Sub LockOneForRead ( _
    variable As String, _
    ByRef variables As Variables _
)
‘사용 방법
Dim instance As VariableDispenser 
Dim variable As String 
Dim variables As Variables

instance.LockOneForRead(variable, variables)
public void LockOneForRead(
    string variable,
    ref Variables variables
)
public:
void LockOneForRead(
    String^ variable, 
    Variables^% variables
)
member LockOneForRead : 
        variable:string * 
        variables:Variables byref -> unit
public function LockOneForRead(
    variable : String, 
    variables : Variables
)

매개 변수

  • variable
    유형: System.String
    The variable you want to lock for read-only access.

주의

This method combines the work of the LockForRead method and the GetVariables method in one call, because 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-only access. To unlock the variable, release the variable collection by using the Unlock method of the Variables class. If the call to the LockOneForRead method fails, the variable is not locked.

Calls to this method do not affect the lock list generated via calls to LockForRead.

[!참고]

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 using the methods LockForRead or LockForWrite, followed by a call to GetVariables.

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

참고 항목

참조

VariableDispenser 클래스

Microsoft.SqlServer.Dts.Runtime 네임스페이스