[
https://issues.apache.org/jira/browse/DBCP-285?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
]
Mark Thomas resolved DBCP-285.
------------------------------
Resolution: Fixed
Making fields private, whilst the technically correct option, would break
compatibility and backwards compatibility takes priority.
The suggested warning has been added.
> BasicDataSource is thread-safe, but allows sub-classes to violate that
> ----------------------------------------------------------------------
>
> Key: DBCP-285
> URL: https://issues.apache.org/jira/browse/DBCP-285
> Project: Commons Dbcp
> Issue Type: Bug
> Reporter: Sebb
>
> BasicDataSource is thread-safe, because all variables are read/written via
> synchronised methods.
> However, since almost all the variables are protected, sub-classes can ignore
> the synchronisation and compromise thread safety.
> Not sure I see the point of allowing a sub-class to do this; the variables
> ought to be private.
> If this cannot be done, then I suggest updating the Javadoc to warn classes
> not to use the instance variables directly.
--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.