1 write to InstanceView
System.Runtime.DurableInstancing (1)
System\Runtime\DurableInstancing\InstancePersistenceContext.cs (1)
60
InstanceView
= newView;
111 references to InstanceView
System.Activities.DurableInstancing (20)
System\Activities\DurableInstancing\LoadWorkflowAsyncResult.cs (5)
70
parameters.Add(new SqlParameter { ParameterName = "@handleIsBoundToLock", SqlDbType = SqlDbType.Bit, Value = base.InstancePersistenceContext.
InstanceView
.IsBoundToLock });
82
Guid instanceId = base.InstancePersistenceContext.
InstanceView
.InstanceId;
117
if (!base.InstancePersistenceContext.
InstanceView
.IsBoundToInstance)
121
if (!base.InstancePersistenceContext.
InstanceView
.IsBoundToInstanceOwner)
125
if (!base.InstancePersistenceContext.
InstanceView
.IsBoundToLock)
System\Activities\DurableInstancing\SaveWorkflowAsyncResult.cs (7)
74
parameters.Add(new SqlParameter { ParameterName = "@instanceId", SqlDbType = SqlDbType.UniqueIdentifier, Value = base.InstancePersistenceContext.
InstanceView
.InstanceId });
77
parameters.Add(new SqlParameter { ParameterName = "@handleIsBoundToLock", SqlDbType = SqlDbType.Bit, Value = base.InstancePersistenceContext.
InstanceView
.IsBoundToLock });
151
if (!base.InstancePersistenceContext.
InstanceView
.IsBoundToLock)
154
instanceLockTracking.TrackStoreLock(base.InstancePersistenceContext.
InstanceView
.InstanceId, instanceVersion, this.DependentTransaction);
319
InstanceView instanceView = context.
InstanceView
;
504
bool metadataConsistency = (base.InstancePersistenceContext.
InstanceView
.InstanceMetadataConsistency == InstanceValueConsistency.None);
598
parameters.Add(new SqlParameter() { SqlDbType = SqlDbType.UniqueIdentifier, ParameterName = instanceIdArgument, Value = base.InstancePersistenceContext.
InstanceView
.InstanceId });
System\Activities\DurableInstancing\SerializationUtilities.cs (3)
116
if (context.
InstanceView
.InstanceMetadataConsistency == InstanceValueConsistency.None)
118
foreach (KeyValuePair<XName, InstanceValue> metadataProperty in context.
InstanceView
.InstanceMetadata)
131
if (context.
InstanceView
.InstanceMetadataConsistency == InstanceValueConsistency.None)
System\Activities\DurableInstancing\SqlWorkflowInstanceStoreAsyncResult.cs (4)
175
Guid instanceId = thisPtr.InstancePersistenceContext.
InstanceView
.InstanceId;
208
Guid instanceId = (thisPtr.InstancePersistenceContext != null) ? thisPtr.InstancePersistenceContext.
InstanceView
.InstanceId : Guid.Empty;
217
if (!thisPtr.InstancePersistenceContext.
InstanceView
.IsBoundToInstance)
274
Guid instanceId = (this.InstancePersistenceContext != null) ? this.InstancePersistenceContext.
InstanceView
.InstanceId : Guid.Empty;
System\Activities\DurableInstancing\TryLoadRunnableWorkflowAsyncResult.cs (1)
45
command.Parameters.Add(new SqlParameter { ParameterName = "@handleIsBoundToLock", SqlDbType = SqlDbType.Bit, Value = base.InstancePersistenceContext.
InstanceView
.IsBoundToLock });
System.Runtime.DurableInstancing (91)
System\Runtime\DurableInstancing\InstanceHandle.cs (1)
994
bool commitSuccessful = this.handle.Commit(this.executionContext.
InstanceView
) != null;
System\Runtime\DurableInstancing\InstancePersistenceContext.cs (90)
88
Fx.Assert(InstanceHandle.Owner == null || InstanceHandle.Owner.OwnerToken ==
InstanceView
.InstanceOwner.OwnerToken, "Mismatched lock tokens.");
155
InstanceView
.BindOwner(owner);
169
InstanceView
.BindInstance(instanceId);
183
if (!
InstanceView
.IsBoundToInstanceOwner)
201
InstanceView
.BindLock(instanceVersion);
244
InstanceView
.StartBindLock(instanceVersion);
251
throw Fx.Exception.AsError(new InstanceHandleConflictException(LastAsyncResult.CurrentCommand.Name,
InstanceView
.InstanceId));
266
throw Fx.Exception.AsError(new InstanceHandleConflictException(LastAsyncResult.CurrentCommand.Name,
InstanceView
.InstanceId));
274
InstanceView
.FinishBindLock(instanceVersion);
285
InstanceView
.InstanceData = data.ReadOnlyCopy(true);
286
InstanceView
.InstanceDataConsistency = InstanceValueConsistency.None;
287
InstanceView
.InstanceState = InstanceState.Initialized;
313
InstanceValueConsistency consistency =
InstanceView
.IsBoundToLock || state == InstanceState.Completed ? InstanceValueConsistency.None : InstanceValueConsistency.InDoubt;
331
view.InstanceKeyMetadataConsistency =
InstanceView
.IsBoundToLock ? InstanceValueConsistency.None : InstanceValueConsistency.InDoubt;
348
InstanceView
.InstanceState = state;
350
InstanceView
.InstanceData = instanceDataCopy;
351
InstanceView
.InstanceDataConsistency = consistency;
353
InstanceView
.InstanceMetadata = instanceMetadataCopy;
354
InstanceView
.InstanceMetadataConsistency = consistency;
356
InstanceView
.InstanceKeys = keysCopy == null ? null : new ReadOnlyDictionaryInternal<Guid, InstanceKeyView>(keysCopy);
357
InstanceView
.InstanceKeysConsistency = consistency;
365
if ((
InstanceView
.InstanceKeysConsistency & InstanceValueConsistency.InDoubt) == 0)
367
foreach (KeyValuePair<Guid, InstanceKeyView> key in
InstanceView
.InstanceKeys)
377
InstanceView
.InstanceState = InstanceState.Completed;
385
if (
InstanceView
.InstanceMetadataConsistency == InstanceValueConsistency.None)
392
InstanceView
.InstanceMetadata = metadata.ReadOnlyCopy(false);
393
InstanceView
.InstanceMetadataConsistency =
InstanceView
.IsBoundToLock ||
InstanceView
.InstanceState == InstanceState.Completed ? InstanceValueConsistency.None : InstanceValueConsistency.InDoubt;
397
if ((
InstanceView
.IsBoundToLock ||
InstanceView
.InstanceState == InstanceState.Completed) && (
InstanceView
.InstanceMetadataConsistency & InstanceValueConsistency.InDoubt) != 0)
400
InstanceView
.InstanceMetadata = metadata.ReadOnlyMergeInto(null, false);
401
InstanceView
.InstanceMetadataConsistency = InstanceValueConsistency.Partial;
405
InstanceView
.InstanceMetadata = metadata.ReadOnlyMergeInto(
InstanceView
.InstanceMetadata, false);
406
InstanceView
.InstanceMetadataConsistency |= InstanceValueConsistency.Partial;
425
InstanceView
.AccumulatedMetadataWrites[name] = value;
438
Dictionary<Guid, InstanceKeyView> copy = new Dictionary<Guid, InstanceKeyView>(
InstanceView
.InstanceKeys);
439
if ((
InstanceView
.InstanceKeysConsistency & InstanceValueConsistency.InDoubt) == 0 && copy.ContainsKey(key))
447
InstanceView
.InstanceKeys = new ReadOnlyDictionaryInternal<Guid, InstanceKeyView>(copy);
461
InstanceView
.InstanceKeys.TryGetValue(key, out existingKeyView);
462
if ((
InstanceView
.InstanceKeysConsistency & InstanceValueConsistency.InDoubt) == 0)
471
else if ((
InstanceView
.InstanceKeysConsistency & InstanceValueConsistency.Partial) == 0)
483
Dictionary<Guid, InstanceKeyView> copy = new Dictionary<Guid, InstanceKeyView>(
InstanceView
.InstanceKeys);
488
InstanceView
.InstanceKeys = new ReadOnlyDictionaryInternal<Guid, InstanceKeyView>(copy);
503
InstanceView
.InstanceKeys.TryGetValue(key, out existingKeyView);
504
if ((
InstanceView
.InstanceKeysConsistency & InstanceValueConsistency.InDoubt) == 0)
513
else if ((
InstanceView
.InstanceKeysConsistency & InstanceValueConsistency.Partial) == 0)
521
Dictionary<Guid, InstanceKeyView> copy = new Dictionary<Guid, InstanceKeyView>(
InstanceView
.InstanceKeys);
523
InstanceView
.InstanceKeys = new ReadOnlyDictionaryInternal<Guid, InstanceKeyView>(copy);
537
if (!
InstanceView
.InstanceKeys.TryGetValue(key, out keyView))
539
if (
InstanceView
.InstanceKeysConsistency == InstanceValueConsistency.None)
544
Dictionary<Guid, InstanceKeyView> copy = new Dictionary<Guid, InstanceKeyView>(
InstanceView
.InstanceKeys);
556
if (!
InstanceView
.IsBoundToLock &&
InstanceView
.InstanceState != InstanceState.Completed)
561
InstanceView
.InstanceKeys = new ReadOnlyDictionaryInternal<Guid, InstanceKeyView>(copy);
573
keyView.InstanceKeyMetadataConsistency =
InstanceView
.IsBoundToLock ||
InstanceView
.InstanceState == InstanceState.Completed ? InstanceValueConsistency.None : InstanceValueConsistency.InDoubt;
577
if ((
InstanceView
.IsBoundToLock ||
InstanceView
.InstanceState == InstanceState.Completed) && (keyView.InstanceKeyMetadataConsistency & InstanceValueConsistency.InDoubt) != 0)
611
if (!
InstanceView
.InstanceKeys.TryGetValue(key, out keyView))
613
if (
InstanceView
.InstanceKeysConsistency == InstanceValueConsistency.None)
620
Dictionary<Guid, InstanceKeyView> copy = new Dictionary<Guid, InstanceKeyView>(
InstanceView
.InstanceKeys);
625
InstanceView
.InstanceKeys = new ReadOnlyDictionaryInternal<Guid, InstanceKeyView>(copy);
626
InstanceView
.InstanceKeysConsistency |= InstanceValueConsistency.Partial;
640
if (
InstanceView
.InstanceOwnerMetadataConsistency == InstanceValueConsistency.None)
647
InstanceView
.InstanceOwnerMetadata = metadata.ReadOnlyCopy(false);
648
InstanceView
.InstanceOwnerMetadataConsistency = InstanceValueConsistency.InDoubt;
652
InstanceView
.InstanceOwnerMetadata = metadata.ReadOnlyMergeInto(
InstanceView
.InstanceOwnerMetadata, false);
653
InstanceView
.InstanceOwnerMetadataConsistency |= InstanceValueConsistency.Partial;
670
InstanceView
.AccumulatedOwnerMetadataWrites.Add(name, value);
681
InstanceView
.QueryResultsBacking.Add(queryResult);
855
if (!
InstanceView
.IsBoundToLock)
863
if (!
InstanceView
.IsBoundToInstance)
871
if (!
InstanceView
.IsBoundToInstanceOwner)
879
if (
InstanceView
.IsBoundToLock &&
InstanceView
.InstanceState == InstanceState.Completed)
887
if (
InstanceView
.IsBoundToLock &&
InstanceView
.InstanceState == InstanceState.Uninitialized)
1221
CurrentCommand.Validate(this.context.
InstanceView
);
1234
else if (!this.context.
InstanceView
.IsBoundToInstanceOwner)
1238
else if (!this.context.
InstanceView
.IsBoundToLock)
1406
IEnumerable<InstancePersistenceCommand> reduction = CurrentCommand.Reduce(this.context.
InstanceView
);
1501
this.finalState = this.context.
InstanceView
.Clone();
1505
this.context.
InstanceView
.InstanceStoreQueryResults = null;
1514
throw Fx.Exception.AsError(new InstanceHandleConflictException(null, this.context.
InstanceView
.InstanceId));
1544
return new InstanceHandleConflictException(null, this.context.
InstanceView
.InstanceId);
1551
this.finalState = this.context.InstanceHandle.Commit(this.context.
InstanceView
);