@@ -209,13 +209,9 @@ def autocommit=(value)
209209        def  ping 
210210          exec_no_retry ( "select 1 from dual" ) 
211211          @active  =  true 
212-         rescue  NativeException  =>  e 
212+         rescue  Java :: JavaSql :: SQLException  =>  e 
213213          @active  =  false 
214-           if  e . message  =~ /^java\. sql\. SQL(Recoverable)?Exception/ 
215-             raise  OracleEnhanced ::ConnectionException ,  e . message 
216-           else 
217-             raise 
218-           end 
214+           raise  OracleEnhanced ::ConnectionException ,  e . message 
219215        end 
220216
221217        # Resets connection, by logging off and creating a new connection. 
@@ -224,13 +220,9 @@ def reset!
224220          begin 
225221            new_connection ( @config ) 
226222            @active  =  true 
227-           rescue  NativeException  =>  e 
223+           rescue  Java :: JavaSql :: SQLException  =>  e 
228224            @active  =  false 
229-             if  e . message  =~ /^java\. sql\. SQL(Recoverable)?Exception/ 
230-               raise  OracleEnhanced ::ConnectionException ,  e . message 
231-             else 
232-               raise 
233-             end 
225+             raise  OracleEnhanced ::ConnectionException ,  e . message 
234226          end 
235227        end 
236228
@@ -239,8 +231,8 @@ def with_retry(&block)
239231          should_retry  =  auto_retry?  && autocommit? 
240232          begin 
241233            yield  if  block_given? 
242-           rescue  NativeException  =>  e 
243-             raise  unless  e . message  =~ /^java \. sql \. SQL(Recoverable)?Exception:  (Closed Connection|Io exception:|No more data to read from socket|IO Error:)/ 
234+           rescue  Java :: JavaSql :: SQLException  =>  e 
235+             raise  unless  e . message  =~ /^(Closed Connection|Io exception:|No more data to read from socket|IO Error:)/ 
244236            @active  =  false 
245237            raise  unless  should_retry 
246238            should_retry  =  false 
@@ -455,11 +447,9 @@ def describe(name)
455447          super 
456448        end 
457449
458-         # Return NativeException /  java.sql.SQLException error code 
450+         # Return java.sql.SQLException error code 
459451        def  error_code ( exception ) 
460452          case  exception 
461-           when  NativeException 
462-             exception . cause . getErrorCode 
463453          when  Java ::JavaSql ::SQLException 
464454            exception . getErrorCode 
465455          else 
0 commit comments