ITsSbResourcePluginStore::AcquireTargetLock method (sbtsv.h)

Locks a target.

Syntax

HRESULT AcquireTargetLock(
  [in]  BSTR     targetName,
  [in]  DWORD    dwTimeout,
  [out] IUnknown **ppContext
);

Parameters

[in] targetName

The name of the target to lock.

[in] dwTimeout

The timeout for the operation, in milliseconds.

[out] ppContext

Returns a pointer to the context of the lock. To release the lock, supply this pointer to the ReleaseTargetLock method.

Return value

If this method succeeds, it returns S_OK. Otherwise, it returns an HRESULT error code.

Remarks

After the lock is acquired, the calling thread is assumed to have exclusive access to the target object and therefore no other thread (within the same machine) can update it. Therefore the calling thread must call the ReleaseTargetLock method as soon as it has made the necessary updates to the target object.

Important  this lock does not completely prevent target objects from being modified externally if more than one Connection Broker exists in the deployment. The calling thread must be prepared to handle a failure gracefully and retry the target update.
 

Requirements

Requirement Value
Minimum supported client None supported
Minimum supported server Windows Server 2016
Target Platform Windows
Header sbtsv.h

See also

ITsSbResourcePluginStore