1 //
2 // Copyright (C) 2004-2008 Maciej Sobczak
3 // Distributed under the Boost Software License, Version 1.0.
4 // (See accompanying file LICENSE_1_0.txt or copy at
5 // http://www.boost.org/LICENSE_1_0.txt)
6 //
7 
8 #ifndef SOCI_TRANSACTION_H_INCLUDED
9 #define SOCI_TRANSACTION_H_INCLUDED
10 
11 #include "soci/soci-platform.h"
12 #include "soci/session.h"
13 
14 namespace soci
15 {
16 
17 class SOCI_DECL transaction
18 {
19 public:
20     explicit transaction(session& sql);
21 
22     ~transaction();
23 
24     void commit();
25     void rollback();
26 
27 private:
28     bool handled_;
29     session& sql_;
30 
31     SOCI_NOT_COPYABLE(transaction)
32 };
33 
34 } // namespace soci
35 
36 #endif // SOCI_TRANSACTION_H_INCLUDED
37