Ejemplo n.º 1
0
 public virtual void Close(ShutdownMode mode)
 {
     lock (_mainContainer.Lock())
     {
         IEnumerator entryIter = _fileName2Container.Iterator();
         while (entryIter.MoveNext())
         {
             IEntry4 hashEntry = (IEntry4)entryIter.Current;
             ClientTransactionPool.ContainerCount containerCount = (ClientTransactionPool.ContainerCount
                                                                    )hashEntry.Value();
             try
             {
                 containerCount.Close(mode);
             }
             catch (Exception t)
             {
                 // If we are in fatal ShutdownMode close will
                 // throw but we want to continue shutting down
                 // all entries.
                 Sharpen.Runtime.PrintStackTrace(t);
             }
         }
         _closed = true;
     }
 }
Ejemplo n.º 2
0
 public virtual void Release(ShutdownMode mode, Transaction transaction, bool rollbackOnClose
                             )
 {
     lock (_mainContainer.Lock())
     {
         ClientTransactionPool.ContainerCount entry = (ClientTransactionPool.ContainerCount
                                                       )_transaction2Container.Get(transaction);
         entry.Container().CloseTransaction(transaction, false, mode.IsFatal() ? false : rollbackOnClose
                                            );
         _transaction2Container.Remove(transaction);
         entry.Release();
         if (entry.IsEmpty())
         {
             _fileName2Container.Remove(entry.FileName());
             try
             {
                 entry.Close(mode);
             }
             catch (Exception t)
             {
                 // If we are in fatal ShutdownMode close will
                 // throw but we want to continue shutting down
                 // all entries.
                 Sharpen.Runtime.PrintStackTrace(t);
             }
         }
     }
 }
Ejemplo n.º 3
0
 public virtual void Close(ShutdownMode mode)
 {
     if ((!_transactionPool.IsClosed()) && (_mainTransaction != null))
     {
         _transactionPool.Release(mode, _mainTransaction, _rollbackOnClose);
     }
 }
		public virtual void Release(ShutdownMode mode, Transaction transaction, bool rollbackOnClose
			)
		{
			lock (_mainContainer.Lock())
			{
				ClientTransactionPool.ContainerCount entry = (ClientTransactionPool.ContainerCount
					)_transaction2Container.Get(transaction);
				entry.Container().CloseTransaction(transaction, false, mode.IsFatal() ? false : rollbackOnClose
					);
				_transaction2Container.Remove(transaction);
				entry.Release();
				if (entry.IsEmpty())
				{
					_fileName2Container.Remove(entry.FileName());
					try
					{
						entry.Close(mode);
					}
					catch (Exception t)
					{
						// If we are in fatal ShutdownMode close will
						// throw but we want to continue shutting down
						// all entries.
						Sharpen.Runtime.PrintStackTrace(t);
					}
				}
			}
		}
		public virtual void Close(ShutdownMode mode)
		{
			if ((!_transactionPool.IsClosed()) && (_mainTransaction != null))
			{
				_transactionPool.Release(mode, _mainTransaction, _rollbackOnClose);
			}
		}
Ejemplo n.º 6
0
 public virtual void ReleaseTransaction(ShutdownMode mode)
 {
     if (_transaction != null)
     {
         _transactionPool.Release(mode, _transaction, _rollbackOnClose);
         _transaction = null;
     }
 }
		public virtual void ReleaseTransaction(ShutdownMode mode)
		{
			if (_transaction != null)
			{
				_transactionPool.Release(mode, _transaction, _rollbackOnClose);
				_transaction = null;
			}
		}
 private bool CloseFile(ShutdownMode mode)
 {
     if (_container != null)
     {
         _transactionPool.Close(mode);
         _container = null;
     }
     return(true);
 }
Ejemplo n.º 9
0
 public virtual void Close(ShutdownMode mode)
 {
     if (!mode.IsFatal())
     {
         _container.Close();
         _container = null;
         return;
     }
     _container.FatalShutdown(((ShutdownMode.FatalMode)mode).Exc());
 }
Ejemplo n.º 10
0
 internal FatalServerShutdown(ObjectServerImpl server, Exception origExc)
 {
     try
     {
         server.Close(ShutdownMode.Fatal(origExc));
     }
     catch (Exception throwable)
     {
         throw new CompositeDb4oException(new Exception[] { origExc, throwable });
     }
 }
        private void CloseMessageDispatchers(ShutdownMode mode)
        {
            IEnumerator i = IterateDispatchers();

            while (i.MoveNext())
            {
                try
                {
                    ((IServerMessageDispatcher)i.Current).Close(mode);
                }
                catch (Exception e)
                {
                    Sharpen.Runtime.PrintStackTrace(e);
                }
            }
        }
 public virtual bool Close(ShutdownMode mode)
 {
     lock (this)
     {
         try
         {
             CloseServerSocket();
             StopCommittedCallbacksDispatcher();
             CloseMessageDispatchers(mode);
             return(CloseFile(mode));
         }
         finally
         {
             TriggerClosed();
         }
     }
 }
		public bool Close(ShutdownMode mode)
		{
			lock (_lock)
			{
				if (!IsMessageDispatcherAlive())
				{
					return true;
				}
				_isClosed = true;
			}
			lock (_mainLock)
			{
				_transactionHandle.ReleaseTransaction(mode);
				if (!mode.IsFatal())
				{
					SendCloseMessage();
				}
				_transactionHandle.Close(mode);
				CloseSocket();
				RemoveFromServer();
				return true;
			}
		}
Ejemplo n.º 14
0
 public bool Close(ShutdownMode mode)
 {
     lock (_lock)
     {
         if (!IsMessageDispatcherAlive())
         {
             return(true);
         }
         _isClosed = true;
     }
     lock (_mainLock)
     {
         _transactionHandle.ReleaseTransaction(mode);
         if (!mode.IsFatal())
         {
             SendCloseMessage();
         }
         _transactionHandle.Close(mode);
         CloseSocket();
         RemoveFromServer();
         return(true);
     }
 }
Ejemplo n.º 15
0
		private void CloseMessageDispatchers(ShutdownMode mode)
		{
			IEnumerator i = IterateDispatchers();
			while (i.MoveNext())
			{
				try
				{
					((IServerMessageDispatcher)i.Current).Close(mode);
				}
				catch (Exception e)
				{
					Sharpen.Runtime.PrintStackTrace(e);
				}
			}
		}
Ejemplo n.º 16
0
		private bool CloseFile(ShutdownMode mode)
		{
			if (_container != null)
			{
				_transactionPool.Close(mode);
				_container = null;
			}
			return true;
		}
			public virtual void Close(ShutdownMode mode)
			{
				if (!mode.IsFatal())
				{
					_container.Close();
					_container = null;
					return;
				}
				_container.FatalShutdown(((ShutdownMode.FatalMode)mode).Exc());
			}
Ejemplo n.º 18
0
		public virtual bool Close(ShutdownMode mode)
		{
			lock (this)
			{
				try
				{
					CloseServerSocket();
					StopCommittedCallbacksDispatcher();
					CloseMessageDispatchers(mode);
					return CloseFile(mode);
				}
				finally
				{
					TriggerClosed();
				}
			}
		}
		public virtual void Close(ShutdownMode mode)
		{
			lock (_mainContainer.Lock())
			{
				IEnumerator entryIter = _fileName2Container.Iterator();
				while (entryIter.MoveNext())
				{
					IEntry4 hashEntry = (IEntry4)entryIter.Current;
					ClientTransactionPool.ContainerCount containerCount = (ClientTransactionPool.ContainerCount
						)hashEntry.Value();
					try
					{
						containerCount.Close(mode);
					}
					catch (Exception t)
					{
						// If we are in fatal ShutdownMode close will
						// throw but we want to continue shutting down
						// all entries.
						Sharpen.Runtime.PrintStackTrace(t);
					}
				}
				_closed = true;
			}
		}