aboutsummaryrefslogtreecommitdiff
path: root/odb/oracle/connection-factory.cxx
diff options
context:
space:
mode:
authorConstantin Michael <constantin@codesynthesis.com>2011-11-29 14:45:51 +0200
committerConstantin Michael <constantin@codesynthesis.com>2011-11-30 11:32:07 +0200
commitc352bdb8b4ee7a636f71a71a301c181942af2d39 (patch)
tree5b7faa4d826a23162a59e241cb800a9f0f7e2db8 /odb/oracle/connection-factory.cxx
parent3ed6a781cf4aad7986f805dc8a8e5c487d10a805 (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/connection-factory.cxx')
-rw-r--r--odb/oracle/connection-factory.cxx7
1 files changed, 4 insertions, 3 deletions
diff --git a/odb/oracle/connection-factory.cxx b/odb/oracle/connection-factory.cxx
index ed59c35..30aa63f 100644
--- a/odb/oracle/connection-factory.cxx
+++ b/odb/oracle/connection-factory.cxx
@@ -126,9 +126,10 @@ namespace odb
// Determine if we need to keep or free this connection.
//
- bool keep (waiters_ != 0 ||
- min_ == 0 ||
- (connections_.size () + in_use_ <= min_));
+ bool keep (!c->failed () &&
+ (waiters_ != 0 ||
+ min_ == 0 ||
+ (connections_.size () + in_use_ <= min_)));
in_use_--;