IBM.Data.DB2.DB2Transaction.Dispose C# (CSharp) Method

Dispose() public method

Dispose method.
public Dispose ( ) : void
return void
		public void Dispose()
		{
			if (state != TransactionState.Open) 
				return;

			Rollback();
		}
	}

Usage Example

Ejemplo n.º 1
0
        public override void Close()
        {
            DB2Transaction transaction = null;

            if (refTransaction != null)
            {
                transaction = (DB2Transaction)refTransaction.Target;
            }
            if ((transaction != null) && refTransaction.IsAlive)
            {
                transaction.Dispose();
            }
            if (refCommands != null)
            {
                for (int i = 0; i < refCommands.Count; i++)
                {
                    DB2Command command = null;
                    if (refCommands[i] != null)
                    {
                        command = (DB2Command)((WeakReference)refCommands[i]).Target;
                    }
                    if ((command != null) && ((WeakReference)refCommands[i]).IsAlive)
                    {
                        try
                        {
                            command.ConnectionClosed();
                        }
                        catch { }
                    }
                    //?? refCommands[i] = null;
                }
            }

            InternalClose();
        }