Exemplo n.º 1
0
        // Unlock all resources for the passed in transaction
        public void UnlockAll(TP.Transaction context)
        {
            // Loop over the resources
            lock (this.ResourceTable)
            {
                // Get resource enumerator
                System.Collections.IDictionaryEnumerator resenum = ResourceTable.GetEnumerator();

                // Loop over resources
                while (resenum.MoveNext())
                {
                    ResourceEntry lockTarget = (ResourceEntry)resenum.Value;
                    lock (lockTarget)
                    {
                        // Unregister all unlock modes for current resource
                        for (int lockMode = (int)LockMode.Read; lockMode < (int)LockMode._Length; lockMode++)
                        {
                            lockTarget.Unregister(context, (LockMode)lockMode);
                        }
                    }
                }
            }

            System.Console.WriteLine("----Unlocked all for Tx: {0}--------", context.Id);
        }