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

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