@itwin/core-backend 5.14.0-dev.4 → 5.14.0-dev.5
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/lib/cjs/SynchronousChannel.d.ts +11 -1
- package/lib/cjs/SynchronousChannel.d.ts.map +1 -1
- package/lib/cjs/SynchronousChannel.js.map +1 -1
- package/lib/cjs/TxnManager.d.ts.map +1 -1
- package/lib/cjs/TxnManager.js +6 -0
- package/lib/cjs/TxnManager.js.map +1 -1
- package/lib/esm/SynchronousChannel.d.ts +11 -1
- package/lib/esm/SynchronousChannel.d.ts.map +1 -1
- package/lib/esm/SynchronousChannel.js.map +1 -1
- package/lib/esm/TxnManager.d.ts.map +1 -1
- package/lib/esm/TxnManager.js +7 -1
- package/lib/esm/TxnManager.js.map +1 -1
- package/package.json +13 -13
|
@@ -14,7 +14,9 @@ export declare namespace SynchronousChannel {
|
|
|
14
14
|
* @beta
|
|
15
15
|
*/
|
|
16
16
|
interface ReserveElementsArgs {
|
|
17
|
-
/** The elements to reserve. The whole batch succeeds or fails together.
|
|
17
|
+
/** The elements to reserve. The whole batch succeeds or fails together.
|
|
18
|
+
* @note Every element listed here becomes a *shared* element that must be inserted identically by every briefcase. See the note on [[SynchronousChannel.Reservations]].
|
|
19
|
+
*/
|
|
18
20
|
elements: Iterable<{
|
|
19
21
|
/** The federationGuid that stably identifies this element across briefcases. Reservations always require an explicit federationGuid. */
|
|
20
22
|
federationGuid: GuidString;
|
|
@@ -27,6 +29,12 @@ export declare namespace SynchronousChannel {
|
|
|
27
29
|
* Interface used to ***reserve*** elements with shared identities as part of [coordinating simultaneous edits]($docs/learning/backend/ConcurrencyControl.md) from multiple briefcases.
|
|
28
30
|
* Unlike **locks** (via [[LockControl]]), which block users from making conflicting changes to existing elements, **reservations** can be used to communicate "in-flight"
|
|
29
31
|
* changes between briefcases, allowing users to concurrently add and use identical dependencies (e.g., component definitions, schemas, etc.) without introducing conflicts.
|
|
32
|
+
*
|
|
33
|
+
* @note A reserved element is a *shared* element: every briefcase that inserts it must insert the **exact same element**. The reservation assigns a single shared
|
|
34
|
+
* ElementId that all briefcases use, and when multiple briefcases push their inserts they are merged together as one row rather than producing a conflict.
|
|
35
|
+
* Because these duplicate inserts are silently collapsed, the property values written by each briefcase are **not** reconciled — if two briefcases insert the same reserved
|
|
36
|
+
* element with *different* contents, one briefcase's values win arbitrarily and the other's changes will be lost. Callers are therefore responsible for ensuring that every
|
|
37
|
+
* insert of a given reserved element has the same property values across all briefcases. Only use reservations for content that is deterministically identical everywhere.
|
|
30
38
|
* @see [[IModelDb.reservations]] to access the reservations for an iModel.
|
|
31
39
|
* @beta
|
|
32
40
|
*/
|
|
@@ -54,6 +62,8 @@ export declare namespace SynchronousChannel {
|
|
|
54
62
|
needsElementReservation(federationGuid: GuidString): boolean;
|
|
55
63
|
/**
|
|
56
64
|
* Acquire reservations for one or more elements from the reservation service, if required and not already reserved by another user.
|
|
65
|
+
* @note Reserving an element establishes a shared identity that every briefcase must insert *identically*. See the note on [[SynchronousChannel.Reservations]] for why divergent
|
|
66
|
+
* inserts of the same reserved element are unsafe.
|
|
57
67
|
* @throws Error if the requested elements are inconsistent with existing reservations, or if any other error occurs while updating the reservations.
|
|
58
68
|
*/
|
|
59
69
|
reserveElements(args: ReserveElementsArgs): Promise<void>;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"SynchronousChannel.d.ts","sourceRoot":"","sources":["../../src/SynchronousChannel.ts"],"names":[],"mappings":"AAIA;;GAEG;AAEH,OAAO,EAAE,UAAU,EAAE,MAAM,qBAAqB,CAAC;AACjD,OAAO,EAAE,SAAS,EAAE,MAAM,oBAAoB,CAAC;AAC/C,OAAO,EAAE,MAAM,EAAE,yBAAyB,EAAE,wBAAwB,EAAE,MAAM,oBAAoB,CAAC;AACjG,OAAO,EAAE,iBAAiB,EAAE,MAAM,WAAW,CAAC;AAE9C;;;GAGG;AACH,yBAAiB,kBAAkB,CAAC;IAClC;;OAEG;IACH,UAAiB,mBAAmB;QAClC
|
|
1
|
+
{"version":3,"file":"SynchronousChannel.d.ts","sourceRoot":"","sources":["../../src/SynchronousChannel.ts"],"names":[],"mappings":"AAIA;;GAEG;AAEH,OAAO,EAAE,UAAU,EAAE,MAAM,qBAAqB,CAAC;AACjD,OAAO,EAAE,SAAS,EAAE,MAAM,oBAAoB,CAAC;AAC/C,OAAO,EAAE,MAAM,EAAE,yBAAyB,EAAE,wBAAwB,EAAE,MAAM,oBAAoB,CAAC;AACjG,OAAO,EAAE,iBAAiB,EAAE,MAAM,WAAW,CAAC;AAE9C;;;GAGG;AACH,yBAAiB,kBAAkB,CAAC;IAClC;;OAEG;IACH,UAAiB,mBAAmB;QAClC;;WAEG;QACH,QAAQ,EAAE,QAAQ,CAAC;YACjB,wIAAwI;YACxI,cAAc,EAAE,UAAU,CAAC;YAC3B,aAAa,EAAE,MAAM,CAAC;YACtB,oJAAoJ;YACpJ,IAAI,CAAC,EAAE,SAAS,CAAC;SAClB,CAAC,CAAC;KACJ;IAED;;;;;;;;;;;;OAYG;IACH,UAAiB,YAAY;QAC3B,eAAe;QACf,QAAQ,CAAC,CAAC,yBAAyB,CAAC,EAAE,OAAO,CAAC;QAE9C,oFAAoF;QACpF,QAAQ,CAAC,aAAa,EAAE,OAAO,CAAC;QAEhC;;;WAGG;QACH,CAAC,MAAM,CAAC,EAAE,MAAM,IAAI,CAAC;QAErB;;;WAGG;QACH,CAAC,wBAAwB,CAAC,EAAE,CAAC,GAAG,EAAE,iBAAiB,KAAK,IAAI,CAAC;QAE7D;;;;;WAKG;QACH,uBAAuB,CAAC,cAAc,EAAE,UAAU,GAAG,OAAO,CAAC;QAE7D;;;;;WAKG;QACH,eAAe,CAAC,IAAI,EAAE,mBAAmB,GAAG,OAAO,CAAC,IAAI,CAAC,CAAC;KAC3D;CAEF"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"SynchronousChannel.js","sourceRoot":"","sources":["../../src/SynchronousChannel.ts"],"names":[],"mappings":"AAAA;;;+FAG+F;AAC/F;;GAEG;AAIH,OAAO,EAAE,MAAM,EAAE,yBAAyB,EAAE,wBAAwB,EAAE,MAAM,oBAAoB,CAAC","sourcesContent":["/*---------------------------------------------------------------------------------------------\r\n* Copyright (c) Bentley Systems, Incorporated. All rights reserved.\r\n* See LICENSE.md in the project root for license terms and full copyright notice.\r\n*--------------------------------------------------------------------------------------------*/\r\n/** @packageDocumentation\r\n * @module iModels\r\n */\r\n\r\nimport { GuidString } from \"@itwin/core-bentley\";\r\nimport { CodeProps } from \"@itwin/core-common\";\r\nimport { _close, _implementationProhibited, _onReservedElementInsert } from \"./internal/Symbols\";\r\nimport { OnElementPropsArg } from \"./Element\";\r\n\r\n/** Types used by the synchronous coordination channels that help multiple briefcases avoid conflicts\r\n * before they appear in the asynchronous changeset timeline.\r\n * @beta\r\n */\r\nexport namespace SynchronousChannel {\r\n /** Arguments for [[SynchronousChannel.Reservations.reserveElements]].\r\n * @beta\r\n */\r\n export interface ReserveElementsArgs {\r\n /** The elements to reserve. The whole batch succeeds or fails together. */\r\n elements: Iterable<{\r\n /** The federationGuid that stably identifies this element across briefcases. Reservations always require an explicit federationGuid. */\r\n federationGuid: GuidString;\r\n classFullName: string;\r\n /** The Code for this element. When a non-empty [[Code.value]] is supplied, it must be unique across all reservations. Defaults to an empty Code. */\r\n code?: CodeProps;\r\n }>;\r\n }\r\n\r\n /**\r\n * Interface used to ***reserve*** elements with shared identities as part of [coordinating simultaneous edits]($docs/learning/backend/ConcurrencyControl.md) from multiple briefcases.\r\n * Unlike **locks** (via [[LockControl]]), which block users from making conflicting changes to existing elements, **reservations** can be used to communicate \"in-flight\"\r\n * changes between briefcases, allowing users to concurrently add and use identical dependencies (e.g., component definitions, schemas, etc.) without introducing conflicts.\r\n * @see [[IModelDb.reservations]] to access the reservations for an iModel.\r\n * @beta\r\n */\r\n export interface Reservations {\r\n /** @internal*/\r\n readonly [_implementationProhibited]: unknown;\r\n\r\n /** @internal true if this Reservations uses a server-based concurrency approach. */\r\n readonly isServerBased: boolean;\r\n\r\n /**\r\n * Close the local reservation database\r\n * @internal\r\n */\r\n [_close]: () => void;\r\n\r\n /**\r\n * Notification that a new element with an explicitly-set federationGuid is being inserted. Called by [[Element.onInsert]]\r\n * @internal\r\n */\r\n [_onReservedElementInsert]: (arg: OnElementPropsArg) => void;\r\n\r\n /**\r\n * Determine whether an ID has already been reserved for a future element with the given federationGuid.\r\n * @note Due to local caching, a return value of `false` cannot be taken as a guarantee that no other briefcase has already reserved the same\r\n * element, only that a reservation for the element with the given federationGuid was seen as of the last call to [[reserveElements]].\r\n * @throws [ElementReservationError]($common) if the federationGuid is not a valid GUID.\r\n */\r\n needsElementReservation(federationGuid: GuidString): boolean;\r\n\r\n /**\r\n * Acquire reservations for one or more elements from the reservation service, if required and not already reserved by another user.\r\n * @throws Error if the requested elements are inconsistent with existing reservations, or if any other error occurs while updating the reservations.\r\n */\r\n reserveElements(args: ReserveElementsArgs): Promise<void>;\r\n }\r\n\r\n}\r\n"]}
|
|
1
|
+
{"version":3,"file":"SynchronousChannel.js","sourceRoot":"","sources":["../../src/SynchronousChannel.ts"],"names":[],"mappings":"AAAA;;;+FAG+F;AAC/F;;GAEG;AAIH,OAAO,EAAE,MAAM,EAAE,yBAAyB,EAAE,wBAAwB,EAAE,MAAM,oBAAoB,CAAC","sourcesContent":["/*---------------------------------------------------------------------------------------------\r\n* Copyright (c) Bentley Systems, Incorporated. All rights reserved.\r\n* See LICENSE.md in the project root for license terms and full copyright notice.\r\n*--------------------------------------------------------------------------------------------*/\r\n/** @packageDocumentation\r\n * @module iModels\r\n */\r\n\r\nimport { GuidString } from \"@itwin/core-bentley\";\r\nimport { CodeProps } from \"@itwin/core-common\";\r\nimport { _close, _implementationProhibited, _onReservedElementInsert } from \"./internal/Symbols\";\r\nimport { OnElementPropsArg } from \"./Element\";\r\n\r\n/** Types used by the synchronous coordination channels that help multiple briefcases avoid conflicts\r\n * before they appear in the asynchronous changeset timeline.\r\n * @beta\r\n */\r\nexport namespace SynchronousChannel {\r\n /** Arguments for [[SynchronousChannel.Reservations.reserveElements]].\r\n * @beta\r\n */\r\n export interface ReserveElementsArgs {\r\n /** The elements to reserve. The whole batch succeeds or fails together.\r\n * @note Every element listed here becomes a *shared* element that must be inserted identically by every briefcase. See the note on [[SynchronousChannel.Reservations]].\r\n */\r\n elements: Iterable<{\r\n /** The federationGuid that stably identifies this element across briefcases. Reservations always require an explicit federationGuid. */\r\n federationGuid: GuidString;\r\n classFullName: string;\r\n /** The Code for this element. When a non-empty [[Code.value]] is supplied, it must be unique across all reservations. Defaults to an empty Code. */\r\n code?: CodeProps;\r\n }>;\r\n }\r\n\r\n /**\r\n * Interface used to ***reserve*** elements with shared identities as part of [coordinating simultaneous edits]($docs/learning/backend/ConcurrencyControl.md) from multiple briefcases.\r\n * Unlike **locks** (via [[LockControl]]), which block users from making conflicting changes to existing elements, **reservations** can be used to communicate \"in-flight\"\r\n * changes between briefcases, allowing users to concurrently add and use identical dependencies (e.g., component definitions, schemas, etc.) without introducing conflicts.\r\n *\r\n * @note A reserved element is a *shared* element: every briefcase that inserts it must insert the **exact same element**. The reservation assigns a single shared\r\n * ElementId that all briefcases use, and when multiple briefcases push their inserts they are merged together as one row rather than producing a conflict.\r\n * Because these duplicate inserts are silently collapsed, the property values written by each briefcase are **not** reconciled — if two briefcases insert the same reserved\r\n * element with *different* contents, one briefcase's values win arbitrarily and the other's changes will be lost. Callers are therefore responsible for ensuring that every\r\n * insert of a given reserved element has the same property values across all briefcases. Only use reservations for content that is deterministically identical everywhere.\r\n * @see [[IModelDb.reservations]] to access the reservations for an iModel.\r\n * @beta\r\n */\r\n export interface Reservations {\r\n /** @internal*/\r\n readonly [_implementationProhibited]: unknown;\r\n\r\n /** @internal true if this Reservations uses a server-based concurrency approach. */\r\n readonly isServerBased: boolean;\r\n\r\n /**\r\n * Close the local reservation database\r\n * @internal\r\n */\r\n [_close]: () => void;\r\n\r\n /**\r\n * Notification that a new element with an explicitly-set federationGuid is being inserted. Called by [[Element.onInsert]]\r\n * @internal\r\n */\r\n [_onReservedElementInsert]: (arg: OnElementPropsArg) => void;\r\n\r\n /**\r\n * Determine whether an ID has already been reserved for a future element with the given federationGuid.\r\n * @note Due to local caching, a return value of `false` cannot be taken as a guarantee that no other briefcase has already reserved the same\r\n * element, only that a reservation for the element with the given federationGuid was seen as of the last call to [[reserveElements]].\r\n * @throws [ElementReservationError]($common) if the federationGuid is not a valid GUID.\r\n */\r\n needsElementReservation(federationGuid: GuidString): boolean;\r\n\r\n /**\r\n * Acquire reservations for one or more elements from the reservation service, if required and not already reserved by another user.\r\n * @note Reserving an element establishes a shared identity that every briefcase must insert *identically*. See the note on [[SynchronousChannel.Reservations]] for why divergent\r\n * inserts of the same reserved element are unsafe.\r\n * @throws Error if the requested elements are inconsistent with existing reservations, or if any other error occurs while updating the reservations.\r\n */\r\n reserveElements(args: ReserveElementsArgs): Promise<void>;\r\n }\r\n\r\n}\r\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"TxnManager.d.ts","sourceRoot":"","sources":["../../src/TxnManager.ts"],"names":[],"mappings":"AAIA;;GAEG;AAGH,OAAO,EACG,OAAO,EAAmD,oBAAoB,EAAE,QAAQ,EAAmB,UAAU,EAAE,YAAY,EAC5I,MAAM,qBAAqB,CAAC;AAC7B,OAAO,
|
|
1
|
+
{"version":3,"file":"TxnManager.d.ts","sourceRoot":"","sources":["../../src/TxnManager.ts"],"names":[],"mappings":"AAIA;;GAEG;AAGH,OAAO,EACG,OAAO,EAAmD,oBAAoB,EAAE,QAAQ,EAAmB,UAAU,EAAE,YAAY,EAC5I,MAAM,qBAAqB,CAAC;AAC7B,OAAO,EAAoB,oBAAoB,EAAE,mBAAmB,EAAE,cAAc,EAAE,kBAAkB,EAAE,0BAA0B,EAAe,yBAAyB,EAAE,sBAAsB,EAA4D,gBAAgB,EAAE,cAAc,EAAE,iBAAiB,EAAE,QAAQ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@ var __disposeResources = (this && this.__disposeResources) || (function (Suppres
|
|
|
59
59
|
});
|
|
60
60
|
import * as touch from "touch";
|
|
61
61
|
import { assert, BeEvent, BentleyError, compareStrings, CompressedId64Set, DbConflictResolution, DbResult, Id64, IModelStatus, IndexMap, Logger, OrderedId64Array } from "@itwin/core-bentley";
|
|
62
|
-
import { IModelError } from "@itwin/core-common";
|
|
62
|
+
import { BriefcaseIdValue, IModelError } from "@itwin/core-common";
|
|
63
63
|
import { BackendLoggerCategory } from "./BackendLoggerCategory";
|
|
64
64
|
import { IpcHost } from "./IpcHost";
|
|
65
65
|
import { _nativeDb } from "./internal/Symbols";
|
|
@@ -1021,6 +1021,12 @@ export class TxnManager {
|
|
|
1021
1021
|
if (args.tableName.startsWith("ec_")) {
|
|
1022
1022
|
return DbConflictResolution.Skip;
|
|
1023
1023
|
}
|
|
1024
|
+
// Skip PRIMARY KEY conflicts for inserted rows that were pre-reserved via SchemaSync - these are the same shared element.
|
|
1025
|
+
const isReserved = (id) => typeof id === "string" && Id64.getBriefcaseId(id) === BriefcaseIdValue.SchemaSyncElementReserved;
|
|
1026
|
+
const pkValues = args.getPrimaryKeyValues();
|
|
1027
|
+
if (args.opcode === "Inserted" && pkValues.length > 0 && pkValues.every(isReserved)) {
|
|
1028
|
+
return DbConflictResolution.Skip;
|
|
1029
|
+
}
|
|
1024
1030
|
}
|
|
1025
1031
|
try {
|
|
1026
1032
|
const resolution = this.rebaser.onConflict(args);
|