#region Copyright
// Advanced.Data.Provider.AdpTransaction
//
// Copyright (C) 2004 Astrein Engenharia de Manuteno S/A
// Copyright (C) 2004 Everaldo Canuto <everaldo_canuto@yahoo.com.br>
//
// This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU Lesser General Public
// License as published by the Free Software Foundation; either
// version 2.1 of the License, or (at your option) any later version.
//
// This library is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
// Lesser General Public License for more details.
//
// You should have received a copy of the GNU Lesser General Public
// License along with this library; if not, write to the Free Software
// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
#endregion
using System;
using System.Data;
namespace Advanced.Data.Provider{
/// <summary>
/// Represents a Transact-SQL transaction to be made in a database server.
/// </summary>
public class AdpTransaction : IAdpTransaction
{
#region Fields
internal IDbTransaction transaction;
internal AdpConnection connection;
#endregion
#region Constructors and destructors
/// <summary>
/// Releases the resources used by the <see cref='AdpDataReader'/>.
/// </summary>
public void Dispose()
{
}
#endregion
#region Public properties
/// <summary>
/// Gets the <see cref='AdpConnection'/> object associated with the transaction, or a null reference (Nothing in Visual Basic) if the transaction is no longer valid.
/// </summary>
IDbConnection System.Data.IDbTransaction.Connection
{
get
{
return connection;
}
}
/// <summary>
/// Gets the <see cref='AdpConnection'/> object associated with the transaction, or a null reference (Nothing in Visual Basic) if the transaction is no longer valid.
/// </summary>
public AdpConnection Connection
{
get
{
return connection;
}
}
/// <summary>
/// Specifies the <see cref='IsolationLevel'/> for this transaction.
/// </summary>
public System.Data.IsolationLevel IsolationLevel
{
get
{
return transaction.IsolationLevel;
}
}
#endregion
#region Public methods
/// <summary>
/// Rolls back a transaction from a pending state.
/// </summary>
public void Rollback()
{
transaction.Rollback();
}
/// <summary>
/// Commits the database transaction.
/// </summary>
public void Commit()
{
transaction.Commit();
}
#endregion
}
}
|