aboutsummaryrefslogtreecommitdiff
path: root/odb/pgsql/database.cxx
diff options
context:
space:
mode:
authorConstantin Michael <constantin@codesynthesis.com>2011-05-11 11:12:49 +0200
committerConstantin Michael <constantin@codesynthesis.com>2011-05-11 11:22:46 +0200
commit4e955852b9d59338a5bb50facc1594e97b8ca2d8 (patch)
tree7839b4c04a49b89873d98c4156b142a35a5fb395 /odb/pgsql/database.cxx
parent78e81069aadc609aee1e4b8137516d9cfce47b0a (diff)
Add transaction support to database
Diffstat (limited to 'odb/pgsql/database.cxx')
-rw-r--r--odb/pgsql/database.cxx15
1 files changed, 9 insertions, 6 deletions
diff --git a/odb/pgsql/database.cxx b/odb/pgsql/database.cxx
index 887061b..080b17f 100644
--- a/odb/pgsql/database.cxx
+++ b/odb/pgsql/database.cxx
@@ -8,6 +8,7 @@
#include <odb/pgsql/database.hxx>
#include <odb/pgsql/exceptions.hxx>
#include <odb/pgsql/connection-factory.hxx>
+#include <odb/pgsql/transaction.hxx>
#include <odb/pgsql/details/options.hxx>
@@ -214,11 +215,13 @@ namespace odb
// {
// }
- // @@ Implement on completion of supporting code.
- //
- // transaction_impl* database::
- // begin ()
- // {
- // }
+ transaction_impl* database::
+ begin ()
+ {
+ if (transaction::has_current ())
+ throw already_in_transaction ();
+
+ return new transaction_impl (*this);
+ }
}
}