- changed milestone to 0.6.9
ORA-00028 is disconnect code
Issue #2200
resolved
Hi there!
After killing oracle session from SQLDeveloper I got
(DatabaseError) ORA-00028: your session has been killed
As I see here sqlalchemy doesn't recognize this as a disconnect error.
In addition, according to cx_Oracle documentation:
With cx_Oracle every exception object has exactly one argument in the args tuple. This argument is a cx_Oracle._Error
_Error has code attribute, so we could use it like this
def is_disconnect(self, e, connection, cursor):
error, = e.args
if isinstance(e, self.dbapi.InterfaceError):
return "not connected" in str(e)
else:
# 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 [3114, 3113](28,)
Comments (4)
-
repo owner -
repo owner oh, its in .args, slightly safer, thought it was error._Error. shrugs
-
repo owner - changed status to resolved
-
repo owner - removed milestone
Removing milestone: 0.6.9 (automated comment)
- Log in to comment
Replying to guest:
that's fine
It's possible cx_oracle 4 didn't have this value. The "ORA-" code formatting comes straight from OCI which is far less likely to change than cx_oracle, which has made some switches on us in the past, particularly that I need to access an underscore attribute to get at this particular attribute. The string approach seems simpler and safer to me.