-
Notifications
You must be signed in to change notification settings - Fork 424
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Mutable static in SQLServerClobBase #186
Comments
Hi @marschall The logger in SQLServerClobBase (abstract class) is present as an object holder for passed logger object while creating a new object of the class that extends it, SQLServerClob or SQLServerNClob. I agree with your point of finalizing logger objects to stop mutation, but in this case, the intention is to log messages as the extended class, and not as per the abstract class and that's the reason, it's passed by constructor. I think the current implementation is intentional and need not be changed since this is an exceptional case, and not a regular logger scenario. |
My point is not so much about finalizing but about semantics. There is only one logger in for all instances of I do not agree with your statement that this is an exceptional case since |
I understand your point now. The reason behind this behavior is basically because logger is static member in I am creating a PR which makes logger Let me know if the PR resolves your query. |
Hi @marschall the fix is merged and released in v6.3.5 - please review it and let us know if it works for you. Closing the issue for now. |
The static field
com.microsoft.sqlserver.jdbc.SQLServerClobBase#logger
is mutable and set by every constructor invocation. It is only used incom.microsoft.sqlserver.jdbc.SQLServerClobBase#free()
. As a result with logger is used there is pretty much random. My recommendation would be to make itstatic final
.The text was updated successfully, but these errors were encountered: