#region Apache Notice /***************************************************************************** * $Header: $ * $Revision: $ * $Date: $ * * iBATIS.NET Data Mapper * Copyright (C) 2004 - Gilles Bayon * * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. * ********************************************************************************/ #endregion #region Imports using System.Data; using IBatisNet.Common; #endregion namespace IBatisNet.DataAccess { /// /// Abstract definition of a DataAccess Session /// public abstract class DaoSession : IDalSession { #region Fields /// /// /// protected DaoManager daoManager = null; #endregion #region Constructor (s) / Destructor /// /// The DaoManager that manages this Dao instance will be passed /// in as the parameter to this constructor automatically upon /// instantiation. /// /// public DaoSession(DaoManager daoManager) { this.daoManager = daoManager; } #endregion #region IDalSession Members #region Properties /// /// /// public abstract DataSource DataSource { get; } /// /// /// public abstract IDbConnection Connection { get; } /// /// /// public abstract IDbTransaction Transaction { get; } #endregion #region Methods /// /// Complete (commit) a transsaction /// public abstract void Complete(); /// /// Opens a database connection. /// public abstract void OpenConnection(); /// /// Open a connection, on the specified connection string. /// /// The connection string public abstract void OpenConnection(string connectionString); /// /// Closes the connection /// public abstract void CloseConnection(); /// /// Begins a transaction. /// public abstract void BeginTransaction(); /// /// Open a connection and begin a transaction on the specified connection string. /// /// The connection string public abstract void BeginTransaction(string connectionString); /// /// Begins a database transaction /// /// Open a connection. public abstract void BeginTransaction(bool openConnection); /// /// Begins a transaction at the data source with the specified IsolationLevel value. /// /// The transaction isolation level for this connection. public abstract void BeginTransaction(IsolationLevel isolationLevel); /// /// Open a connection and begin a transaction on the specified connection string. /// /// The connection string /// The transaction isolation level for this connection. public abstract void BeginTransaction(string connectionString, IsolationLevel isolationLevel); /// /// Begins a transaction on the current connection /// with the specified IsolationLevel value. /// /// The transaction isolation level for this connection. /// Open a connection. public abstract void BeginTransaction(bool openConnection, IsolationLevel isolationLevel); /// /// Begins a transaction on the current connection /// with the specified IsolationLevel value. /// /// The transaction isolation level for this connection. /// The connection string /// Open a connection. public abstract void BeginTransaction(string connectionString, bool openConnection, IsolationLevel isolationLevel); /// /// Commits the database transaction. /// /// /// Will close the connection. /// public abstract void CommitTransaction(); /// /// Commits the database transaction. /// /// Close the connection public abstract void CommitTransaction(bool closeConnection); /// /// Rolls back a transaction from a pending state. /// /// /// Will close the connection. /// public abstract void RollBackTransaction(); /// /// Rolls back a transaction from a pending state. /// /// Close the connection public abstract void RollBackTransaction(bool closeConnection); /// /// /// /// /// public abstract IDbCommand CreateCommand(CommandType commandType); /// /// Create an IDataParameter /// /// An IDataParameter. public abstract IDataParameter CreateDataParameter(); /// /// /// /// public abstract IDbDataAdapter CreateDataAdapter(); /// /// /// /// /// public abstract IDbDataAdapter CreateDataAdapter(IDbCommand command); #endregion #endregion #region IDisposable Members #region Methods /// /// Releasing, or resetting resources. /// public abstract void Dispose(); #endregion #endregion } }