summaryrefslogtreecommitdiff
path: root/odb/oracle/transaction.cxx
diff options
context:
space:
mode:
authorConstantin Michael <constantin@codesynthesis.com>2011-09-05 12:10:45 +0200
committerConstantin Michael <constantin@codesynthesis.com>2011-09-05 16:08:45 +0200
commit63295f6e051e75cf07cb6212a2631df8eb8a90c4 (patch)
tree79aa54d3cdfa2b29c7f1a52829d12495250e6d9f /odb/oracle/transaction.cxx
parentd6518580059c6a0d34d7a1683fabc3bfcc4b5e27 (diff)
Add database, connection, connection-factory, and transaction support
Diffstat (limited to 'odb/oracle/transaction.cxx')
-rw-r--r--odb/oracle/transaction.cxx26
1 files changed, 26 insertions, 0 deletions
diff --git a/odb/oracle/transaction.cxx b/odb/oracle/transaction.cxx
new file mode 100644
index 0000000..412328b
--- /dev/null
+++ b/odb/oracle/transaction.cxx
@@ -0,0 +1,26 @@
+// file : odb/oracle/transaction.cxx
+// author : Constantin Michael <constantin@codesynthesis.com>
+// copyright : Copyright (c) 2009-2011 Code Synthesis Tools CC
+// license : ODB NCUEL; see accompanying LICENSE file
+
+#include <odb/oracle/transaction.hxx>
+
+namespace odb
+{
+ namespace oracle
+ {
+ transaction& transaction::
+ current ()
+ {
+ // While the impl type can be of the concrete type, the transaction
+ // object can be created as either odb:: or odb::oracle:: type. To
+ // work around that we are going to hard-cast one to the other
+ // relying on the fact that they have the same representation and
+ // no virtual functions. The former is checked in the tests.
+ //
+ odb::transaction& b (odb::transaction::current ());
+ dynamic_cast<transaction_impl&> (b.implementation ());
+ return reinterpret_cast<transaction&> (b);
+ }
+ }
+}