Exemple #1
0
        private AsyncDocumentSession OpenAsyncSessionInternal(OpenSessionOptions options)
        {
            AssertInitialized();
            EnsureNotClosed();

            var sessionId = Guid.NewGuid();

            currentSessionId = sessionId;
            try
            {
                var databaseName    = options.Database ?? DefaultDatabase ?? MultiDatabase.GetDatabaseName(Url);
                var requestExecuter = GetRequestExecuter(databaseName);
                var session         = new AsyncDocumentSession(databaseName, this, requestExecuter, sessionId);
                //AfterSessionCreated(session);
                return(session);
            }
            finally
            {
                currentSessionId = null;
            }
        }
Exemple #2
0
        public override IDocumentSession OpenSession(OpenSessionOptions options)
        {
            EnsureNotClosed();

            var sessionId = Guid.NewGuid();

            currentSessionId = sessionId;
            try
            {
                var databaseName    = options.Database ?? DefaultDatabase ?? MultiDatabase.GetDatabaseName(Url);
                var requestExecuter = GetRequestExecuter(databaseName);
                var session         = new DocumentSession(databaseName, this, sessionId, requestExecuter);
                RegisterEvents(session);
                // AfterSessionCreated(session);
                return(session);
            }
            finally
            {
                currentSessionId = null;
            }
        }
Exemple #3
0
 public override IAsyncDocumentSession OpenAsyncSession(OpenSessionOptions options)
 {
     return(OpenAsyncSessionInternal(options));
 }