ConcurrencyControl Class

Beta

ConcurrencyControl enables an app to coordinate local changes with changes that are being made by others to an iModel.

Methods

Name Description
constructor(_iModel: IModelDb): ConcurrencyControl    
abandonRequest(): void Abandon any pending requests for locks or codes.  
areAvailable(requestContext: AuthorizedClientRequestContext, req?: ConcurrencyControl.Request): Promise<boolean> Check to see if all of the requested resources could be acquired from iModelHub.  
areCodesAvailable(requestContext: AuthorizedClientRequestContext, req?: ConcurrencyControl.Request): Promise<boolean> Check to see if all of the codes in the specified request are available.  
lockCodeSpecs(requestContext: AuthorizedClientRequestContext): Promise<Lock[]> Obtain the CodeSpec lock.  
lockSchema(requestContext: AuthorizedClientRequestContext): Promise<Lock[]> Obtain the schema lock.  
queryCodeStates(requestContext: AuthorizedClientRequestContext, specId: Id64String, scopeId: string, _value?: string): Promise<HubCode[]>    
request(requestContext: AuthorizedClientRequestContext, req?: ConcurrencyControl.Request): Promise<void> Try to acquire locks and/or reserve codes from iModelHub.  
reserveCodes(requestContext: AuthorizedClientRequestContext, codes: Code[]): Promise<HubCode[]> Reserve the specified codes.  
setPolicy(policy: ConcurrencyControl.PessimisticPolicy | ConcurrencyControl.OptimisticPolicy): void Set the concurrency control policy.  
convertRequestToAny(req: ConcurrencyControl.Request): any Static Convert the request to any  
createRequest(): ConcurrencyControl.Request Static Create an empty Request  

Properties

Name Type Description
codes Accessor ReadOnly ConcurrencyControl.Codes API to reserve Codes and query the status of Codes  
hasPendingRequests Accessor ReadOnly boolean Are there pending, unprocessed requests for locks or codes?  

Defined in

Last Updated: 08 January, 2020