Beispiel #1
0
        public Task Commit(CancellationToken cancellationToken = default)
        {
            if (SuppressStoreAndCommit)
            {
                return(Task.CompletedTask);
            }

            return(StorageSession.Commit(cancellationToken));
        }
Beispiel #2
0
        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));
        }
Beispiel #3
0
 public void Dispose()
 {
     StorageSession.Dispose();
 }
Beispiel #4
0
 public CosmosOutboxTransaction(ContainerHolderResolver resolver, ContextBag context)
 {
     StorageSession = new StorageSession(resolver, context, false);
 }