diff options
author | Constantin Michael <constantin@codesynthesis.com> | 2011-11-29 14:45:51 +0200 |
---|---|---|
committer | Constantin Michael <constantin@codesynthesis.com> | 2011-11-30 11:32:07 +0200 |
commit | c352bdb8b4ee7a636f71a71a301c181942af2d39 (patch) | |
tree | 5b7faa4d826a23162a59e241cb800a9f0f7e2db8 /odb/oracle/error.hxx | |
parent | 3ed6a781cf4aad7986f805dc8a8e5c487d10a805 (diff) |
Improve the Oracle translate_error implementation
The improved implementation scans all the records associated with an error
handle. Furthermore, if it is established that the connection to the database
has been lost, the connection is marked as such. Additionally, all special
exceptions (deadlock, timeout, and connection_lost) are now supported.
Diffstat (limited to 'odb/oracle/error.hxx')
-rw-r--r-- | odb/oracle/error.hxx | 13 |
1 files changed, 5 insertions, 8 deletions
diff --git a/odb/oracle/error.hxx b/odb/oracle/error.hxx index 43a314d..a5dbb10 100644 --- a/odb/oracle/error.hxx +++ b/odb/oracle/error.hxx @@ -10,6 +10,7 @@ #include <oci.h> +#include <odb/oracle/forward.hxx> #include <odb/oracle/version.hxx> #include <odb/oracle/details/export.hxx> @@ -18,19 +19,15 @@ namespace odb namespace oracle { void - translate_error (void* h, ub4 t, sword s); - - // @@ Check connection state attribute once connection has been - // implemented. - // + translate_error (void* h, ub4 t, sword s, connection*); // Translate OCI error given an error handle and throw an appropriate // exception. // inline LIBODB_ORACLE_EXPORT void - translate_error (OCIError* h, sword s) + translate_error (OCIError* h, sword s, connection* c = 0) { - translate_error (h, OCI_HTYPE_ERROR, s); + translate_error (h, OCI_HTYPE_ERROR, s, c); } // Translate an OCI error given an environment handle error and throw @@ -39,7 +36,7 @@ namespace odb inline LIBODB_ORACLE_EXPORT void translate_error (OCIEnv* h) { - translate_error (h, OCI_HTYPE_ENV, OCI_ERROR); + translate_error (h, OCI_HTYPE_ENV, OCI_ERROR, 0); } } } |