internal static SessionContext CreateSessionContext(ConnectionStringSettings setting) { if (!DbInitialized) { DatabaseInitialize(); } SessionContext db = new SessionContext(setting.Name); if (!SessionInitialized) { EnsureDatabaseCreated(db); ExecuteSql(db, "CREATE INDEX IX_Sessions_Expires ON Sessions (Expires)"); SessionInitialized = true; } return db; }
private static void ReleaseItemNoSave(SessionContext db, string id, object lockId) { id = AppendAppIdHash(id); Session session = db.Sessions.Find(new object[] { id }); if (((session != null) && session.Locked) && (session.LockCookie == ((int) lockId))) { session.Locked = false; } }