VariableDispenser.LockOneForRead Method
Puts the variable in a list, and then locks it for read-only access.
命名空间: Microsoft.SqlServer.Dts.Runtime
程序集: Microsoft.SqlServer.ManagedDTS (in microsoft.sqlserver.manageddts.dll)
语法
声明
Public Sub LockOneForRead ( _
variable As String, _
ByRef variables As Variables _
)
public void LockOneForRead (
string variable,
ref Variables variables
)
public:
void LockOneForRead (
String^ variable,
Variables^% variables
)
public void LockOneForRead (
String variable,
/** @ref */ Variables variables
)
JScript 不支持由引用传递值类型参数。
参数
- variable
The variable you want to lock for read-only access.
- variables
The name of the variables collection to put the requested variable into.
备注
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.
线程安全
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