Пример #1
0
 public bool BeingActionTpl(Session session, Statement cs)
 {
     if (cs != null)
     {
         if (session.AbortTransaction)
         {
             return(false);
         }
         session.TempSet.Clear();
         if (cs.IsCatalogChange())
         {
             if (this._catalogWriteSession == null)
             {
                 this.GetTransactionSessions(session.TempSet);
                 session.TempSet.Remove(session);
                 if (session.TempSet.IsEmpty())
                 {
                     this._catalogWriteSession = session;
                     this._isLockedMode        = true;
                 }
                 else
                 {
                     this._catalogWriteSession = session;
                     this._isLockedMode        = true;
                     TransactionManagerCommon.SetWaitingSessionTpl(session);
                 }
                 return(true);
             }
             this._catalogWriteSession.WaitingSessions.Add(session);
             session.Latch.CountUp();
             return(true);
         }
         if (this._isLockedMode)
         {
             if ((cs.GetTableNamesForRead().Length == 0) && (cs.GetTableNamesForWrite().Length == 0))
             {
                 return(true);
             }
             if (cs.GetTableNamesForWrite().Length != 0)
             {
                 if (cs.GetTableNamesForWrite()[0].schema == SqlInvariants.LobsSchemaQname)
                 {
                     return(true);
                 }
             }
             else if ((cs.GetTableNamesForRead().Length != 0) && (cs.GetTableNamesForRead()[0].schema == SqlInvariants.LobsSchemaQname))
             {
                 return(true);
             }
             this._catalogWriteSession.WaitingSessions.Add(session);
             session.Latch.CountUp();
         }
     }
     return(true);
 }
Пример #2
0
 public void BeginAction(Session session, Statement cs)
 {
     if (!session.HasLocks(cs))
     {
         lock (base.Lock)
         {
             if (base.SetWaitedSessionsTpl(session, cs))
             {
                 if (session.TempSet.IsEmpty())
                 {
                     base.LockTablesTpl(session, cs);
                 }
                 else
                 {
                     TransactionManagerCommon.SetWaitingSessionTpl(session);
                 }
             }
         }
     }
 }