| |||||||||||||||||
Source File | Conditionals | Statements | Methods | TOTAL | |||||||||||||
IDalSession.cs | - | - | - | - |
|
1 | ||
2 | #region Apache Notice | |
3 | /***************************************************************************** | |
4 | * $Header: $ | |
5 | * $Revision: $ | |
6 | * $Date: $ | |
7 | * | |
8 | * iBATIS.NET Data Mapper | |
9 | * Copyright (C) 2004 - Gilles Bayon | |
10 | * | |
11 | * | |
12 | * Licensed under the Apache License, Version 2.0 (the "License"); | |
13 | * you may not use this file except in compliance with the License. | |
14 | * You may obtain a copy of the License at | |
15 | * | |
16 | * http://www.apache.org/licenses/LICENSE-2.0 | |
17 | * | |
18 | * Unless required by applicable law or agreed to in writing, software | |
19 | * distributed under the License is distributed on an "AS IS" BASIS, | |
20 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | |
21 | * See the License for the specific language governing permissions and | |
22 | * limitations under the License. | |
23 | * | |
24 | ********************************************************************************/ | |
25 | #endregion | |
26 | ||
27 | #region Imports | |
28 | using System; | |
29 | using System.Data; | |
30 | #endregion | |
31 | ||
32 | ||
33 | namespace IBatisNet.Common | |
34 | { | |
35 | /// <summary> | |
36 | /// A template for a session in the iBATIS.NET framwork. | |
37 | /// Holds teh connection, the transaction ... | |
38 | /// </summary> | |
39 | public interface IDalSession : IDisposable | |
40 | { | |
41 | /// <summary> | |
42 | /// The data source use by the session. | |
43 | /// </summary> | |
44 | DataSource DataSource | |
45 | { | |
46 | get; | |
47 | } | |
48 | ||
49 | /// <summary> | |
50 | /// The Connection use by the session. | |
51 | /// </summary> | |
52 | IDbConnection Connection | |
53 | { | |
54 | get; | |
55 | } | |
56 | ||
57 | /// <summary> | |
58 | /// The Transaction use by the session. | |
59 | /// </summary> | |
60 | IDbTransaction Transaction | |
61 | { | |
62 | get; | |
63 | } | |
64 | ||
65 | /// <summary> | |
66 | /// Complete (commit) a transsaction | |
67 | /// </summary> | |
68 | void Complete(); | |
69 | ||
70 | /// <summary> | |
71 | /// Open a connection. | |
72 | /// </summary> | |
73 | void OpenConnection(); | |
74 | ||
75 | /// <summary> | |
76 | /// close a connection | |
77 | /// </summary> | |
78 | void CloseConnection(); | |
79 | ||
80 | /// <summary> | |
81 | /// Open a connection and begin a transaction | |
82 | /// </summary> | |
83 | void BeginTransaction(); | |
84 | ||
85 | /// <summary> | |
86 | /// Begins a database transaction | |
87 | /// </summary> | |
88 | /// <param name="openConnection">Open a connection.</param> | |
89 | void BeginTransaction(bool openConnection); | |
90 | ||
91 | /// <summary> | |
92 | /// Open a connection and begin a transaction at the data source | |
93 | /// with the specified IsolationLevel value. | |
94 | /// </summary> | |
95 | /// <param name="isolationLevel">The transaction isolation level for this connection.</param> | |
96 | void BeginTransaction(IsolationLevel isolationLevel); | |
97 | ||
98 | /// <summary> | |
99 | /// Begins a transaction on the current connection | |
100 | /// with the specified IsolationLevel value. | |
101 | /// </summary> | |
102 | /// <param name="isolationLevel">The transaction isolation level for this connection.</param> | |
103 | /// <param name="openConnection">Open a connection.</param> | |
104 | void BeginTransaction(bool openConnection, IsolationLevel isolationLevel); | |
105 | ||
106 | /// <summary> | |
107 | /// Commit a transaction and close the associated connection | |
108 | /// </summary> | |
109 | void CommitTransaction(); | |
110 | ||
111 | /// <summary> | |
112 | /// Commits the database transaction. | |
113 | /// </summary> | |
114 | /// <param name="closeConnection">Close the connection</param> | |
115 | void CommitTransaction(bool closeConnection); | |
116 | ||
117 | /// <summary> | |
118 | /// Rollbak a transaction and close the associated connection | |
119 | /// </summary> | |
120 | void RollBackTransaction(); | |
121 | ||
122 | /// <summary> | |
123 | /// Rolls back a transaction from a pending state. | |
124 | /// </summary> | |
125 | /// <param name="closeConnection">Close the connection</param> | |
126 | void RollBackTransaction(bool closeConnection); | |
127 | ||
128 | /// <summary> | |
129 | /// Create a command | |
130 | /// </summary> | |
131 | /// <param name="commandType">The type of the command</param> | |
132 | /// <returns>An IDbCommand.</returns> | |
133 | IDbCommand CreateCommand(CommandType commandType); | |
134 | ||
135 | /// <summary> | |
136 | /// Create an IDataParameter | |
137 | /// </summary> | |
138 | /// <returns>An IDataParameter.</returns> | |
139 | IDataParameter CreateDataParameter(); | |
140 | ||
141 | /// <summary> | |
142 | /// Create a DataAdapter | |
143 | /// </summary> | |
144 | /// <param name="command">The statement or stored procedure | |
145 | /// used to select records in the data source.</param> | |
146 | /// <returns>An IDbDataAdapter.</returns> | |
147 | IDbDataAdapter CreateDataAdapter(IDbCommand command); | |
148 | ||
149 | /// <summary> | |
150 | /// Create a DataAdapter | |
151 | /// </summary> | |
152 | /// <returns>An IDbDataAdapter.</returns> | |
153 | IDbDataAdapter CreateDataAdapter(); | |
154 | } | |
155 | } | |
156 |
|