Oracle.jdbc.ReadTimeout Prevents Proper Query Timeout Handling, Causing Connection Leak
(Doc ID 2561983.1)
Last updated on FEBRUARY 06, 2024
Applies to:
JDBC - Version 12.2.0.0.0 and laterInformation in this document applies to any platform.
Symptoms
Using the JDBC driver 18.3 along with oracle.jdbc.ReadTimeout property, it is throwing an IllegalStateException and does not properly free up the database resources.
It causes a session leak on the database side, eventually hitting the maximum number of processes, which then prevents any new connection to the database.
While using an JDBC driver ( version 11.2.0.3.0, 11.2.0.4 and 12.1.0.2.0), this works as expected and when a query times out, this will throw a SQLTimeoutException.
With JDBC Driver 11.2.0.4 and 12.1.0.2
-----------------------
java.sql.SQLTimeoutException: ORA-01013: user requested cancel of current operation
With JDBC Driver 12.2.0.1, 18.3.0.0, 19.3.0.0
-----------------------
java.lang.IllegalStateException: Interrupt task is already scheduled for the thread Thread[main,5,main] and the type SO_TIMEOUT
at oracle.net.nt.TimeoutInterruptHandler.scheduleInterrupt(TimeoutInterruptHandler.java:75)
at oracle.net.nt.TimeoutInterruptHandler.scheduleInterrupt(TimeoutInterruptHandler.java:93)
at oracle.net.nt.TimeoutSocketChannel.scheduleInterrupt(TimeoutSocketChannel.java:239)
at oracle.net.nt.TimeoutSocketChannel.write(TimeoutSocketChannel.java:202)
at oracle.net.ns.NIOMarkerPacket.writeToSocketChannel(NIOMarkerPacket.java:117)
at oracle.net.ns.NSProtocolNIO.sendMarker(NSProtocolNIO.java:518)
at oracle.net.ns.NSProtocolNIO.sendReset(NSProtocolNIO.java:467)
at oracle.jdbc.driver.T4CMAREngineNIO.prepareForUnmarshall(T4CMAREngineNIO.java:767)
at oracle.jdbc.driver.T4CMAREngineNIO.unmarshalUB1(T4CMAREngineNIO.java:427)
at oracle.jdbc.driver.T4CTTIfun.receive(T4CTTIfun.java:394)
at oracle.jdbc.driver.T4CTTIfun.doRPC(T4CTTIfun.java:255)
the above issue happens only when connecting to Database server which is running on Windows OS.
Changes
Cause
To view full details, sign in with your My Oracle Support account. |
|
Don't have a My Oracle Support account? Click to get started! |
In this Document
Symptoms |
Changes |
Cause |
Solution |
References |