aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBoris Kolpackov <boris@codesynthesis.com>2012-06-18 16:05:11 +0200
committerBoris Kolpackov <boris@codesynthesis.com>2012-06-18 16:05:11 +0200
commitbe5d50d5e68f2dbf904378480b26495249720320 (patch)
treea0828399f333dd79a220ce46896362a869b64e6b
parentdcd9226bedc5afb97193d3b62ea47434c0d8e47d (diff)
Remove unnecessary checks for current transaction
-rw-r--r--odb/database.cxx3
-rw-r--r--odb/database.txx5
2 files changed, 3 insertions, 5 deletions
diff --git a/odb/database.cxx b/odb/database.cxx
index b9a6d80..5da6a40 100644
--- a/odb/database.cxx
+++ b/odb/database.cxx
@@ -14,9 +14,6 @@ namespace odb
unsigned long long database::
execute (const char* st, std::size_t n)
{
- if (!transaction::has_current ())
- throw not_in_transaction ();
-
connection_type& c (transaction::current ().connection ());
return c.execute (st, n);
}
diff --git a/odb/database.txx b/odb/database.txx
index 7f7b90f..7ac19d7 100644
--- a/odb/database.txx
+++ b/odb/database.txx
@@ -115,8 +115,9 @@ namespace odb
{
// T is always object_type.
//
- if (!transaction::has_current ())
- throw not_in_transaction ();
+
+ // We don't need to check for transaction here;
+ // object_traits::query () does this.
result<T> r (query_<T, class_traits<T>::kind>::call (*this, q));