public SQLiteStorageEngineFactory(BeakerSQLiteConnection connection)
 {
     this.Connection = connection;
 }
예제 #2
0
        /// <summary>
        /// Gets the session by the given sessionId. 
        /// If there is no session, a new one is created.
        /// </summary>
        /// <returns>The session.</returns>
        /// <param name="sessionId">Session identifier.</param>
        public BeakerSQLiteConnection GetSession(Guid sessionId)
        {
            lock (sessionLock)
            {
                if (this.Connections.ContainsKey(sessionId))
                {
                    return this.Connections[sessionId];
                }

                BeakerSQLiteConnection newConnection = new BeakerSQLiteConnection(this.DatabasePath);
                this.Connections[sessionId] = newConnection;
                return newConnection;
            }
        }