private IAsyncDocumentSession OpenAsyncSessionInternal(OpenSessionOptions options) { AssertInitialized(); EnsureNotClosed(); var sessionId = Guid.NewGuid(); currentSessionId = sessionId; try { var asyncDatabaseCommands = SetupCommandsAsync(AsyncDatabaseCommands, options.Database, options.Credentials, options); if (AsyncDatabaseCommands == null) { throw new InvalidOperationException("You cannot open an async session because it is not supported on embedded mode"); } var session = new AsyncDocumentSession(options.Database, this, asyncDatabaseCommands, Listeners, sessionId) { DatabaseName = options.Database ?? DefaultDatabase ?? MultiDatabase.GetDatabaseName(Url) }; AfterSessionCreated(session); return(session); } finally { currentSessionId = null; } }
public override IDocumentSession OpenSession(OpenSessionOptions options) { EnsureNotClosed(); var sessionId = Guid.NewGuid(); currentSessionId = sessionId; try { var session = new DocumentSession(this, listeners, sessionId, SetupCommands(DatabaseCommands, options.Database, options.Credentials, options) #if !NET35 , SetupCommandsAsync(AsyncDatabaseCommands, options.Database, options.Credentials, options) #endif ) { DatabaseName = options.Database }; AfterSessionCreated(session); return(session); } finally { currentSessionId = null; } }
public override IDocumentSession OpenSession(OpenSessionOptions options) { EnsureNotClosed(); var sessionId = Guid.NewGuid(); currentSessionId = sessionId; try { var databaseName = options.Database ?? DefaultDatabase ?? MultiDatabase.GetDatabaseName(Url); var session = new DocumentSession(databaseName, this, Listeners, sessionId, SetupCommands(DatabaseCommands, databaseName, options.Credentials, options)); AfterSessionCreated(session); return(session); } finally { currentSessionId = null; } }
public IDocumentSession OpenSession(OpenSessionOptions sessionOptions) { return Inner.OpenSession(sessionOptions); }
/// <summary> /// Opens the session with the specified options. /// </summary> public IDocumentSession OpenSession(OpenSessionOptions sessionOptions) { return server.DocumentStore.OpenSession(sessionOptions); }
/// <summary> /// Opens the session with the specified options. /// </summary> public override IDocumentSession OpenSession(OpenSessionOptions sessionOptions) { return OpenSessionInternal(sessionOptions.Database, ShardStrategy.Shards.ToDictionary(x => x.Key, x => x.Value.DatabaseCommands .ForDatabase(sessionOptions.Database) .With(sessionOptions.Credentials))); }
public override IAsyncDocumentSession OpenAsyncSession(OpenSessionOptions options) { return OpenAsyncSessionInternal(options); }
private IAsyncDocumentSession OpenAsyncSessionInternal(OpenSessionOptions options) { AssertInitialized(); EnsureNotClosed(); var sessionId = Guid.NewGuid(); currentSessionId = sessionId; try { var asyncDatabaseCommands = SetupCommandsAsync(AsyncDatabaseCommands, options.Database, options.Credentials, options); if (AsyncDatabaseCommands == null) throw new InvalidOperationException("You cannot open an async session because it is not supported on embedded mode"); var session = new AsyncDocumentSession(options.Database, this, asyncDatabaseCommands, Listeners, sessionId) { DatabaseName = options.Database ?? DefaultDatabase ?? MultiDatabase.GetDatabaseName(Url) }; AfterSessionCreated(session); return session; } finally { currentSessionId = null; } }
public override IAsyncDocumentSession OpenAsyncSession(OpenSessionOptions options) { return(OpenAsyncSessionInternal(options)); }
public IAsyncDocumentSession OpenAsyncSession(OpenSessionOptions options) { return(OpenAsyncSessionInternal(options.Database, SetupCommandsAsync(AsyncDatabaseCommands, options.Database, options.Credentials, options))); }
public IAsyncDocumentSession OpenAsyncSession(OpenSessionOptions options) { return OpenAsyncSessionInternal(options.Database, SetupCommandsAsync(AsyncDatabaseCommands, options.Database, options.Credentials, options)); }
public abstract IAsyncDocumentSession OpenAsyncSession(OpenSessionOptions sessionOptions);
public IDocumentSession OpenSession(OpenSessionOptions sessionOptions) { if (!string.IsNullOrWhiteSpace(sessionOptions.Database)) { throw new NotImplementedException("BrnklyDocumentStore does not support opening a session with a database name. The database name must be specified in the constructor."); } return this.innerStore.OpenSession(sessionOptions); }
public IDocumentSession OpenSession(OpenSessionOptions sessionOptions) { if (!string.IsNullOrWhiteSpace(sessionOptions.Database)) { throw GetDatabaseNotSupportedException(); } return this.InnerStore.OpenSession(sessionOptions); }
private static IAsyncDatabaseCommands SetupCommandsAsync(IAsyncDatabaseCommands databaseCommands, string database, ICredentials credentialsForSession, OpenSessionOptions options) { if (database != null) { databaseCommands = databaseCommands.ForDatabase(database); } if (credentialsForSession != null) { databaseCommands = databaseCommands.With(credentialsForSession); } if (options.ForceReadFromMaster) { databaseCommands.ForceReadFromMaster(); } return(databaseCommands); }
public override IDocumentSession OpenSession(OpenSessionOptions options) { EnsureNotClosed(); var sessionId = Guid.NewGuid(); currentSessionId = sessionId; try { var session = new DocumentSession(options.Database, this, Listeners, sessionId, SetupCommands(DatabaseCommands, options.Database, options.Credentials, options)) { DatabaseName = options.Database ?? DefaultDatabase ?? MultiDatabase.GetDatabaseName(Url) }; AfterSessionCreated(session); return session; } finally { currentSessionId = null; } }
private static IAsyncDatabaseCommands SetupCommandsAsync(IAsyncDatabaseCommands databaseCommands, string database, ICredentials credentialsForSession, OpenSessionOptions options) { if (database != null) databaseCommands = databaseCommands.ForDatabase(database); if (credentialsForSession != null) databaseCommands = databaseCommands.With(credentialsForSession); if (options.ForceReadFromMaster) databaseCommands.ForceReadFromMaster(); return databaseCommands; }
public abstract IDocumentSession OpenSession(OpenSessionOptions sessionOptions);
public IDocumentSession OpenSession(OpenSessionOptions sessionOptions) { throw new NotImplementedException(); }