Ejemplo n.º 1
0
        internal void UnenlistTransaction(MySqlXaTransaction xaTransaction)
        {
            if (!object.ReferenceEquals(xaTransaction, m_xaTransaction))
            {
                throw new InvalidOperationException("Active transaction is not the one being unenlisted from.");
            }
            m_xaTransaction = null;

            if (m_shouldCloseWhenUnenlisted)
            {
                m_shouldCloseWhenUnenlisted = false;
                Close();
            }
        }
Ejemplo n.º 2
0
        public override void EnlistTransaction(System.Transactions.Transaction transaction)
        {
            if (m_xaTransaction != null)
            {
                throw new MySqlException("Already enlisted in a Transaction.");
            }
            if (CurrentTransaction != null)
            {
                throw new InvalidOperationException("Can't enlist in a Transaction when there is an active MySqlTransaction.");
            }

            if (transaction != null)
            {
                m_xaTransaction = new MySqlXaTransaction(this);
                m_xaTransaction.Start(transaction);
            }
        }