@@ -65,10 +65,39 @@ cdef class Message:
65
65
connection" error is detected, the connection is forced closed
66
66
immediately.
67
67
"""
68
+ cdef bint is_recoverable = False
68
69
if self .error_occurred:
70
+ if self .error_info.num in (
71
+ 28 , # session has been terminated
72
+ 31 , # session marked for kill
73
+ 376 , # file %s cannot be read at this time
74
+ 603 , # ORACLE server session terminated
75
+ 1012 , # not logged on
76
+ 1033 , # ORACLE initialization or shutdown in progress
77
+ 1034 , # the Oracle instance is not available for use
78
+ 1089 , # immediate shutdown or close in progress
79
+ 1090 , # shutdown in progress
80
+ 1092 , # ORACLE instance terminated
81
+ 1115 , # IO error reading block from file %s (block # %s)
82
+ 2396 , # exceeded maximum idle time
83
+ 3113 , # end-of-file on communication channel
84
+ 3114 , # not connected to ORACLE
85
+ 3135 , # connection lost contact
86
+ 12153 , # TNS:not connected
87
+ 12514 , # Service %s is not registered with the listener
88
+ 12537 , # TNS:connection closed
89
+ 12547 , # TNS:lost contact
90
+ 12570 , # TNS:packet reader failure
91
+ 12571 , # TNS:packet writer failure
92
+ 12583 , # TNS:no reader
93
+ 12757 , # instance does not currently know of requested service
94
+ 16456 , # missing or invalid value
95
+ ):
96
+ is_recoverable = True
69
97
error = errors._Error(self .error_info.message,
70
98
code = self .error_info.num,
71
- offset = self .error_info.pos)
99
+ offset = self .error_info.pos,
100
+ isrecoverable = is_recoverable)
72
101
if error.is_session_dead:
73
102
self .conn_impl._protocol._force_close()
74
103
raise error.exc_type(error)
0 commit comments