fede8419583de404a867b6d778893df0db4415cb
[mono.git] / mcs / class / FirebirdSql.Data.Firebird / FirebirdSql.Data.Common / ITransaction.cs
1 /*
2  *      Firebird ADO.NET Data provider for .NET and Mono 
3  * 
4  *         The contents of this file are subject to the Initial 
5  *         Developer's Public License Version 1.0 (the "License"); 
6  *         you may not use this file except in compliance with the 
7  *         License. You may obtain a copy of the License at 
8  *         http://www.firebirdsql.org/index.php?op=doc&id=idpl
9  *
10  *         Software distributed under the License is distributed on 
11  *         an "AS IS" basis, WITHOUT WARRANTY OF ANY KIND, either 
12  *         express or implied. See the License for the specific 
13  *         language governing rights and limitations under the License.
14  * 
15  *      Copyright (c) 2002, 2005 Carlos Guzman Alvarez
16  *      All Rights Reserved.
17  */
18
19 using System;
20 using System.Data;
21
22 namespace FirebirdSql.Data.Common
23 {
24         #region Enumerations
25
26         internal enum TransactionState
27         {
28                 NoTransaction,
29                 TrasactionStarting,
30                 TransactionStarted,
31                 TransactionPreparing,
32                 TransactionPrepared,
33                 TransactionCommiting,
34                 TransactionRollbacking
35         }
36
37         #endregion
38
39         #region Delegates
40
41         internal delegate void TransactionUpdateEventHandler(object sender, EventArgs e);
42
43         #endregion
44
45         internal interface ITransaction : IDisposable
46         {
47                 #region Events
48
49                 event TransactionUpdateEventHandler Update;
50
51                 #endregion
52
53                 #region Properties
54
55                 int Handle
56                 {
57                         get;
58                 }
59
60                 TransactionState State
61                 {
62                         get;
63                 }
64
65                 #endregion
66
67                 #region Methods
68
69                 void BeginTransaction(TransactionParameterBuffer tpb);
70                 void Commit();
71                 void CommitRetaining();
72                 void Rollback();
73                 void RollbackRetaining();
74                 // void Prepare();
75                 // void Prepare(byte[] buffer);
76
77                 #endregion
78         }
79 }