#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; using System.Data; #endregion namespace IBatisNet.Common { /// /// A template for a session in the iBATIS.NET framwork. /// Holds the connection, the transaction ... /// public interface IDalSession : IDisposable { /// /// The data source use by the session. /// DataSource DataSource { get; } /// /// The Connection use by the session. /// IDbConnection Connection { get; } /// /// The Transaction use by the session. /// IDbTransaction Transaction { get; } /// /// Complete (commit) a transsaction /// void Complete(); /// /// Open a connection. /// void OpenConnection(); /// /// Open a connection, on the specified connection string. /// /// The connection string void OpenConnection(string connectionString); /// /// close a connection /// void CloseConnection(); /// /// Open a connection and begin a transaction /// void BeginTransaction(); /// /// Open a connection and begin a transaction on the specified connection string. /// /// The connection string void BeginTransaction(string connectionString); /// /// Begins a database transaction /// /// Open a connection. void BeginTransaction(bool openConnection); /// /// Open a connection and begin a transaction on the specified connection string. /// /// The connection string /// The transaction isolation level for this connection. void BeginTransaction(string connectionString, IsolationLevel isolationLevel); /// /// Open a connection and begin a transaction at the data source /// with the specified IsolationLevel value. /// /// The transaction isolation level for this connection. void BeginTransaction(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. void BeginTransaction(string connectionString, bool openConnection, IsolationLevel isolationLevel); /// /// Begins a transaction on the current connection /// with the specified IsolationLevel value. /// /// The transaction isolation level for this connection. /// Open a connection. void BeginTransaction(bool openConnection, IsolationLevel isolationLevel); /// /// Commit a transaction and close the associated connection /// void CommitTransaction(); /// /// Commits the database transaction. /// /// Close the connection void CommitTransaction(bool closeConnection); /// /// Rollbak a transaction and close the associated connection /// void RollBackTransaction(); /// /// Rolls back a transaction from a pending state. /// /// Close the connection void RollBackTransaction(bool closeConnection); /// /// Create a command /// /// The type of the command /// An IDbCommand. IDbCommand CreateCommand(CommandType commandType); /// /// Create an IDataParameter /// /// An IDataParameter. IDataParameter CreateDataParameter(); /// /// Create a DataAdapter /// /// The statement or stored procedure /// used to select records in the data source. /// An IDbDataAdapter. IDbDataAdapter CreateDataAdapter(IDbCommand command); /// /// Create a DataAdapter /// /// An IDbDataAdapter. IDbDataAdapter CreateDataAdapter(); } }