public Task Commit(CancellationToken cancellationToken = default) { if (SuppressStoreAndCommit) { return(Task.CompletedTask); } return(StorageSession.Commit(cancellationToken)); }
public Task <ICompletableSynchronizedStorageSession> OpenSession(ContextBag contextBag, CancellationToken cancellationToken = default) { var storageSession = new StorageSession(containerHolderResolver, contextBag, true); //The null-conditional is to allow the PersistenceTests to run. //CurrentSharedTransactionalBatchBehavior.Invoke calls CreateScope which is needed for SetCurrent to work. //This is a workaround since PersistenceTests do not execute behaviors. currentSharedTransactionalBatchHolder?.SetCurrent(storageSession); return(Task.FromResult <ICompletableSynchronizedStorageSession>(storageSession)); }
public void Dispose() { StorageSession.Dispose(); }
public CosmosOutboxTransaction(ContainerHolderResolver resolver, ContextBag context) { StorageSession = new StorageSession(resolver, context, false); }