public void Rollback(SinglePhaseEnlistment singlePhaseEnlistment)
        {
            // prevent commands in main thread to run concurrently
            Driver driver = connection.driver;

            lock (driver)
            {
                rollbackThreadId = Thread.CurrentThread.ManagedThreadId;
                while (connection.Reader != null)
                {
                    // wait for reader to finish. Maybe we should not wait
                    // forever and cancel it after some time?
                    System.Threading.Thread.Sleep(100);
                }
                simpleTransaction.Rollback();
                singlePhaseEnlistment.Aborted();
                DriverTransactionManager.RemoveDriverInTransaction(baseTransaction);

                driver.CurrentTransaction = null;

                if (connection.State == ConnectionState.Closed)
                {
                    connection.CloseFully();
                }
                rollbackThreadId = 0;
            }
        }
        internal void CloseFully()
        {
            if (Settings.Pooling && driver.IsOpen)
            {
                // if we are in a transaction, roll it back
                if (driver.HasStatus(ServerStatusFlags.InTransaction))
                {
                    MyCatTransaction t = new MyCatTransaction(this, IsolationLevel.Unspecified);
                    t.Rollback();
                }

                MyCatPoolManager.ReleaseConnection(driver);
            }
            driver.Close();
            driver = null;
        }