summaryrefslogtreecommitdiff
path: root/lib/sqlalchemy/dialects/oracle
diff options
context:
space:
mode:
authorMike Bayer <mike_mp@zzzcomputing.com>2011-07-01 16:52:11 -0400
committerMike Bayer <mike_mp@zzzcomputing.com>2011-07-01 16:52:11 -0400
commite936a7b359a205e0476b932a1f175f5da7289e06 (patch)
tree161e369330c3446b6bbd122fc2a4cdbadda00317 /lib/sqlalchemy/dialects/oracle
parent409a95adf44f577a204114469ff414bebefca293 (diff)
downloadsqlalchemy-e936a7b359a205e0476b932a1f175f5da7289e06.tar.gz
- Failures on connect which raise dbapi.Error
will forward the error to dialect.is_disconnect() and set the "connection_invalidated" flag if the dialect knows this to be a potentially "retryable" condition. Only Oracle ORA-01033 implemented for now. [ticket:2201] - Added ORA-01033 to disconnect codes, which can be caught during a connection event. [ticket:2201]
Diffstat (limited to 'lib/sqlalchemy/dialects/oracle')
-rw-r--r--lib/sqlalchemy/dialects/oracle/cx_oracle.py7
1 files changed, 5 insertions, 2 deletions
diff --git a/lib/sqlalchemy/dialects/oracle/cx_oracle.py b/lib/sqlalchemy/dialects/oracle/cx_oracle.py
index 4f0cdffcf..29d9e2ab0 100644
--- a/lib/sqlalchemy/dialects/oracle/cx_oracle.py
+++ b/lib/sqlalchemy/dialects/oracle/cx_oracle.py
@@ -689,11 +689,14 @@ class OracleDialect_cx_oracle(OracleDialect):
error, = e.args
if isinstance(e, self.dbapi.InterfaceError):
return "not connected" in str(e)
- else:
+ elif hasattr(error, 'code'):
# ORA-00028: your session has been killed
# ORA-03114: not connected to ORACLE
# ORA-03113: end-of-file on communication channel
- return error.code in (28, 3114, 3113)
+ # ORA-01033: ORACLE initialization or shutdown in progress
+ return error.code in (28, 3114, 3113, 1033)
+ else:
+ return False
def create_xid(self):
"""create a two-phase transaction ID.