Main Page
Related Pages
Modules
Namespaces
Classes
Files
Examples
File List
File Members
cetlib
cetlib
sqlite
Transaction.h
Go to the documentation of this file.
1
#ifndef cetlib_sqlite_Transaction_h
2
#define cetlib_sqlite_Transaction_h
3
4
// ====================================================================
5
// Transaction
6
//
7
// A Transaction object encapsulates a single SQLite transaction. Such
8
// transactions cannot be nested. Look into using SAVEPOINT if you
9
// need nesting.
10
//
11
// Creating a Transaction begins a transaction in the given db, which
12
// is to have been already be opened.
13
//
14
// A transaction is committed by specifying 'commit()', which can be
15
// called ONLY ONCE per transaction object. If 'commit' is not called
16
// before the Transaction object is destroyed, then the transaction is
17
// rolled back.
18
// ====================================================================
19
20
struct
sqlite3
;
21
22
namespace
cet::sqlite
{
23
24
class
Transaction
{
25
public
:
26
explicit
Transaction
(
sqlite3
* db) noexcept(
false
);
27
~Transaction
() noexcept;
28
29
void
commit
() noexcept(
false
);
30
31
// Transactions may not be copied or moved.
32
Transaction
(
Transaction
const
&) =
delete
;
33
Transaction
(
Transaction
&&) =
delete
;
34
Transaction
&
operator=
(
Transaction
const
&) =
delete
;
35
Transaction
&
operator=
(
Transaction
&&) =
delete
;
36
37
private
:
38
sqlite3
*
db_
;
39
};
40
41
}
// cet::sqlite
42
43
#endif
/* cetlib_sqlite_Transaction_h */
44
45
// Local Variables:
46
// mode: c++
47
// End:
cet::sqlite::Transaction
Definition:
Transaction.h:24
cet::sqlite::Transaction::Transaction
Transaction(sqlite3 *db) noexcept(false)
Definition:
Transaction.cc:20
cet::sqlite
Definition:
column.h:38
sqlite3
struct sqlite3 sqlite3
Definition:
DatabaseSupport.h:12
cet::sqlite::Transaction::db_
sqlite3 * db_
Definition:
Transaction.h:38
cet::sqlite::Transaction::commit
void commit() noexcept(false)
Definition:
Transaction.cc:42
cet::sqlite::Transaction::~Transaction
~Transaction() noexcept
Definition:
Transaction.cc:31
cet::sqlite::Transaction::operator=
Transaction & operator=(Transaction const &)=delete
Generated by
1.8.11