Class ContextTransaction
java.lang.Object
com._1c.g5.v8.internal.derived.context.ContextTransaction
Demarkation of derived data context (
For the information on the current strategy of conflict resolving please check the
IObjectDerivedDataContext
) transaction operations.
One could read/change multiple DD contexts within a single transaction. All affected contexts are being
tracked by the IDerivedDataContextManager
and being the subject of the conflict control.For the information on the current strategy of conflict resolving please check the
IDerivedDataContextManager
.-
Constructor Summary
ConstructorsConstructorDescriptionContextTransaction
(IContextTransactionManager transactionManager, boolean computation, boolean forcedUpdate, Object computationCause, boolean trackWaitingScope) Creates an instance of the transaction being controlled by the external transaction manager. -
Method Summary
Modifier and TypeMethodDescriptionvoid
commit()
Commits the transaction using the attached scope.void
confirmOperationComputation
(OperationContext operationContext) Сonfirms the successive operation computationgetExistingObjectContext
(Object objectId, String segmentId) Gets existing contextgetObjectContext
(long bmObjectId, org.eclipse.emf.ecore.EClass objectEClass, String segmentId) Gets the object context for the specified scope.getObjectContext
(IBmObject bmObject, String segmentId) Gets the object context for the specified scope.getObjectContext
(Object objectId, org.eclipse.emf.ecore.EClass objectEClass, String segmentId) Gets the object context for the specified scope.boolean
isContextExists
(IBmObject bmObject, String segmentId) Checks if the DD context exists(supported) for the given object and segmentboolean
isContextExists
(org.eclipse.emf.ecore.EClass topObjectEClass, long topObjectId, String segmentId) Checks if the DD context exists(supported) for the given object and segmentvoid
markAsComputed
(IObjectDerivedDataContext context) Marks the context as a computed.void
markAsFailed
(IObjectDerivedDataContext context) Marks the context as a failed.void
rollback()
Rolls back the transaction discarding all collected context changes.scheduleModalOperation
(Consumer<org.eclipse.core.runtime.IProgressMonitor> operation, String operationSegment, IModalOperationController modalOperationController) Schedules a new modal operationscheduleOperation
(Consumer<org.eclipse.core.runtime.IProgressMonitor> operation, OperationType operationType, boolean important, String segmentId) Schedules the operationvoid
Schedules the removal of previously scheduled operation
-
Constructor Details
-
ContextTransaction
public ContextTransaction(IContextTransactionManager transactionManager, boolean computation, boolean forcedUpdate, Object computationCause, boolean trackWaitingScope) Creates an instance of the transaction being controlled by the external transaction manager.- Parameters:
transactionManager
- The instance of the transaction manager. Cannot benull
.computation
- This transaction is used during the DD computation cycle.forcedUpdate
- Forces update of contexts, even if they aren't changedcomputationCause
- The object bound to the computation context and used to track computations.trackWaitingScope
- Enables collection of the implicit waiting scope if true
-
-
Method Details
-
getExistingObjectContext
Gets existing context- Parameters:
objectId
- The identifier of the object. Cannot benull
.segmentId
- The identifier of the DD segment. Cannot benull
.- Returns:
- Existing context if corresponding context exists; null otherwise.
-
commit
public void commit()Commits the transaction using the attached scope. -
getObjectContext
Gets the object context for the specified scope. Registers a new global instance in case if it's a first context gathering.- Parameters:
bmObject
- The BM object instance. Cannot benull
.segmentId
- The identifier of the DD segment. Cannot benull
.- Returns:
- The attached context for the givent context. Never
null
.
-
getObjectContext
public IObjectDerivedDataContext getObjectContext(Object objectId, org.eclipse.emf.ecore.EClass objectEClass, String segmentId) Gets the object context for the specified scope. Registers a new global instance in case if it's a first context gathering.- Parameters:
objectId
- The object instance. Cannot benull
.objectEClass
- The EClass of the object. Cannot benull
.segmentId
- The identifier of the DD segment. Cannot benull
.- Returns:
- The attached context for the givent context. Never
null
.
-
scheduleOperation
public IObjectDerivedDataContext scheduleOperation(Consumer<org.eclipse.core.runtime.IProgressMonitor> operation, OperationType operationType, boolean important, String segmentId) Schedules the operation- Parameters:
operation
- The operation executable. May not benull
operationType
- The type of the operation. May not benull
important
-segmentId
- Target segment of the pipeline. May not benull
- Returns:
- the scheduled operation context. May not be
null
-
scheduleOperationRemoval
Schedules the removal of previously scheduled operation- Parameters:
handle
- The handle of the operation. May not benull
-
isContextExists
Checks if the DD context exists(supported) for the given object and segment- Parameters:
bmObject
- The object to get the context for. May not benull
segmentId
- The DD segment identifier. May not benull
- Returns:
- True if the context exists/may be created
-
isContextExists
public boolean isContextExists(org.eclipse.emf.ecore.EClass topObjectEClass, long topObjectId, String segmentId) Checks if the DD context exists(supported) for the given object and segment- Parameters:
topObjectEClass
- Top objectEClass
. May not benull
topObjectId
- Top object identifier. May not benull
segmentId
- The DD segment identifier. May not benull
- Returns:
- True if the context exists/may be created
-
getObjectContext
public IObjectDerivedDataContext getObjectContext(long bmObjectId, org.eclipse.emf.ecore.EClass objectEClass, String segmentId) Gets the object context for the specified scope. Registers a new global instance in case if it's a first context gathering.- Parameters:
bmObjectId
- The identifier of the BM object.objectEClass
- TheEClass
of the BM object. Cannot benull
.bmObject
- The BM object instance. Cannot benull
.segmentId
- The identifier of the DD segment. Cannot benull
.- Returns:
- The attached context for the givent context. Cannot be
null
.
-
markAsComputed
Marks the context as a computed. Will be re-set on a commit.- Parameters:
context
- Transaction context. Cannot benull
.
-
confirmOperationComputation
Сonfirms the successive operation computation- Parameters:
operationContext
- The operation context to confirm. May not benull
-
markAsFailed
Marks the context as a failed.- Parameters:
context
- Transaction context. Cannot benull
.
-
rollback
public void rollback()Rolls back the transaction discarding all collected context changes. -
scheduleModalOperation
public IObjectDerivedDataContext scheduleModalOperation(Consumer<org.eclipse.core.runtime.IProgressMonitor> operation, String operationSegment, IModalOperationController modalOperationController) Schedules a new modal operation- Parameters:
operation
- The operation executable to schedule. May not benull
operationSegment
- The target segment of the async pipeline. May not benull
modalOperationController
- The modal operation controller. May not benull
- Returns:
- The context of the scheduled operation. May not be
null
-