mirror of
https://github.com/alibaba/druid.git
synced 2023-03-04 19:17:16 +00:00
fix oracle connection socket leak
This commit is contained in:
@@ -130,15 +130,16 @@ public final class DruidConnectionHolder {
|
||||
String connClassName = conClass.getName();
|
||||
if ((!ORACLE_SOCKET_FIELD_ERROR) && connClassName.equals("oracle.jdbc.driver.T4CConnection")) {
|
||||
try {
|
||||
if (ORACLE_FIELD_NT == null) {
|
||||
if (ORACLE_FIELD_NET == null) {
|
||||
Field field = conClass.getDeclaredField("net");
|
||||
field.setAccessible(true);
|
||||
ORACLE_FIELD_NT = field;
|
||||
ORACLE_FIELD_NET = field;
|
||||
}
|
||||
Object net = ORACLE_FIELD_NT.get(conn);
|
||||
Object net = ORACLE_FIELD_NET.get(conn);
|
||||
|
||||
if (ORACLE_FIELD_S_ATTS == null) {
|
||||
Field field = net.getClass().getDeclaredField("sAtts");
|
||||
// NSProtocol
|
||||
Field field = net.getClass().getSuperclass().getDeclaredField("sAtts");
|
||||
field.setAccessible(true);
|
||||
ORACLE_FIELD_S_ATTS = field;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user