コード例 #1
0
ファイル: ModelHelper.cs プロジェクト: wyxy2005/bluceNet
 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;
 }
コード例 #2
0
 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;
     }
 }