rasdaman complete source
Main Page
Modules
Namespaces
Classes
Files
File List
File Members
reladminif
transactionif.hh
Go to the documentation of this file.
1
#ifndef _TRANSACTIONIF_HH_
2
#define _TRANSACTIONIF_HH_
3
4
/*
5
* This file is part of rasdaman community.
6
*
7
* Rasdaman community is free software: you can redistribute it and/or modify
8
* it under the terms of the GNU General Public License as published by
9
* the Free Software Foundation, either version 3 of the License, or
10
* (at your option) any later version.
11
*
12
* Rasdaman community is distributed in the hope that it will be useful,
13
* but WITHOUT ANY WARRANTY; without even the implied warranty of
14
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15
* GNU General Public License for more details.
16
*
17
* You should have received a copy of the GNU General Public License
18
* along with rasdaman community. If not, see <http://www.gnu.org/licenses/>.
19
*
20
* Copyright 2003, 2004, 2005, 2006, 2007, 2008, 2009 Peter Baumann /
21
rasdaman GmbH.
22
*
23
* For more information please see <http://www.rasdaman.org>
24
* or contact Peter Baumann via <baumann@rasdaman.com>.
25
*/
26
/************************************************************************
27
*
28
*
29
* PURPOSE:
30
*
31
*
32
* COMMENTS:
33
*
34
***********************************************************************/
35
36
//@ManMemo: Module: {\bf transactionif}.
37
38
/*@Doc:
39
TransactionIf has the functionality to begin, commit and abort a base
40
DBMS transaction.
41
*/
42
43
class
TransactionIf
;
44
class
DatabaseIf
;
45
46
#include <iostream>
47
48
#include "
raslib/error.hh
"
52
class
TransactionIf
53
{
54
public
:
55
void
begin
(
DatabaseIf
* currBase,
bool
readOnly =
false
)
throw
(
r_Error
);
56
/*@Doc:
57
begin a TA.
58
By default, the TA started is a write TA. If {\tt readOnly} is set to 1,
59
the TA will be read only.
60
*/
61
62
void
commit
()
throw
(
r_Error
);
63
/*@Doc:
64
commit a transaction. make all changes permanent.
65
r_Error is thrown when any objects have problems
66
writting themselves to the database.
67
AdminIf::compCompTiles(), TypeFactory::freeTempTypes,
68
ObjectBroker::clearBroker, OId::deinitialize are called.
69
COMMIT is issued. the database is closed.
70
the benchmark timers are stopped.
71
*/
72
73
void
abort
();
74
/*@Doc:
75
abort a TA. don't make changes permanent.
76
AdminIf::compCompTiles(), TypeFactory::freeTempTypes,
77
ObjectBroker::clearBroker, OId::deinitialize are called.
78
ROLLBACK is issued. the database is closed.
79
the benchmark timers are stopped.
80
*/
81
82
DatabaseIf
*
getDatabaseIf
();
83
/*@Doc:
84
returns the DatabaseIf object associated with this transaction.
85
*/
86
87
private
:
88
void
begin
(
bool
readOnly =
false
)
throw
(
r_Error
);
89
/*@Doc:
90
begin a TA. Internal usage only.
91
This function does not work if the appropriate initializations have'nt
92
been done. For that reason, it is only appropriate for internal usage.
93
By default, the TA started is a write TA. If {\tt readOnly} is set to 1,
94
the TA will be read only.
95
benchmark timers are started.
96
*/
97
98
bool
isReadOnly;
99
/*@Doc:
100
keeps track if the current TA is read only or not
101
*/
102
103
static
DatabaseIf
* lastBase;
104
/*@Doc:
105
stores the last base used in begin();
106
*/
107
};
108
109
#endif
DatabaseIf
Definition:
databaseif.hh:66
TransactionIf::commit
void commit()
r_Error
Definition:
error.hh:88
TransactionIf::getDatabaseIf
DatabaseIf * getDatabaseIf()
TransactionIf
Definition:
transactionif.hh:52
error.hh
TransactionIf::abort
void abort()
TransactionIf::begin
void begin(DatabaseIf *currBase, bool readOnly=false)
Generated on Sat Mar 7 2015 23:10:28 for rasdaman complete source by
1.8.8