You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Microsoft SQL Server 2017 (RTM-CU24) (KB5001228) - 14.0.3391.2 (X64) Apr 28 2021 10:32:18 Copyright (C) 2017 Microsoft Corporation Standard Edition (64-bit) on Windows Server 2016 Standard 10.0 (Build 14393: ) (Hypervisor)
Client Operating System
Windows Server 2016
JAVA/JVM version
OpenJDK 64-Bit Server VM, 1.8.0_232-b18
Table schema
Problem description
In com.microsoft.sqlserver.jdbc.SQLServerConnection the field loggingClassName is private static.
The class constructor bellow appends a new connection id to this static field every time a new instance is constructed. This used with the SQLServerConnectionPoolDataSource creates over time a huge string of few MBs and the logging is inconsistent, because the connection cannot be identified. Please make these fields none static in order to remove this issue.
Consider doing this within the DataSource implementations as well, where there is no memory leak, put it is still inconsistent because of the static field.
Regards,
Zoltan Imreh
The text was updated successfully, but these errors were encountered:
imreh-zoltan
changed the title
Logging class name is static, creates memory leak and logging inconsistency.
The loggingClassName field is static, creates memory leak and logging inconsistency.
Aug 31, 2021
Driver version
9.2.1.jre8
SQL Server version
Microsoft SQL Server 2017 (RTM-CU24) (KB5001228) - 14.0.3391.2 (X64) Apr 28 2021 10:32:18 Copyright (C) 2017 Microsoft Corporation Standard Edition (64-bit) on Windows Server 2016 Standard 10.0 (Build 14393: ) (Hypervisor)
Client Operating System
Windows Server 2016
JAVA/JVM version
OpenJDK 64-Bit Server VM, 1.8.0_232-b18
Table schema
Problem description
In com.microsoft.sqlserver.jdbc.SQLServerConnection the field loggingClassName is private static.
The class constructor bellow appends a new connection id to this static field every time a new instance is constructed. This used with the SQLServerConnectionPoolDataSource creates over time a huge string of few MBs and the logging is inconsistent, because the connection cannot be identified. Please make these fields none static in order to remove this issue.
private static String loggingClassName = "com.microsoft.sqlserver.jdbc.SQLServerConnection:";
SQLServerConnection(String parentInfo) throws SQLServerException {
int connectionID = nextConnectionID(); // sequential connection id
traceID = "ConnectionID:" + connectionID;
loggingClassName += connectionID;
if (connectionlogger.isLoggable(Level.FINE))
connectionlogger.fine(toString() + " created by (" + parentInfo + ")");
initResettableValues();
Consider doing this within the DataSource implementations as well, where there is no memory leak, put it is still inconsistent because of the static field.
Regards,
Zoltan Imreh
The text was updated successfully, but these errors were encountered: