bug #8170
openjavax.sql.DataSource.getConnection() implementation in WrappedCdmDataSource does not conform to the interface
0%
Description
the documentation of javax.sql.DataSource.getConnection()
reads like "Attempts to establish* a connection with the data source that this DataSource object represents."*
all implementations actually attempt to create a new connection. WrappedCdmDataSource does implement this method not in compliance with the interface by caching the first connection created as existingConnection
. This quite dangerous since a developer would not expect this implementation to behave so differently.
This can cause problems as described in #8132 and other nasty bugs.
Related issues
Updated by Andreas Kohlbecker over 5 years ago
- Related to bug #8132: phycobank cdm-server instance problems with db connections added
Updated by Andreas Kohlbecker over 5 years ago
- Related to bug #8171: javax.sql.DataSource.getConnection() implementation in WrappedCdmDataSource fails to cache the connection which and leaves it unclosed added
Updated by Andreas Müller over 5 years ago
- Status changed from New to Feedback
- Assignee changed from Andreas Müller to Andreas Kohlbecker
Is this still an open issue after #8171 is solved now?
I also do not fully understand the solution. In #8171 you seem to cache the connection now while in this ticket your write that it is expected behavior that a NEW connection is created each time.
But I did not have a detailed look to it. Just wanted to ask before I spend much time.
Updated by Andreas Kohlbecker over 5 years ago
- Assignee changed from Andreas Kohlbecker to Andreas Müller
I opened issue #8171 only for fixing the most severe problem quickly by storing the new connection in the cache field.
This ticket is to find a better solution for the WrappedCdmDataSource
which should conform to the interface it implements. This solution might also include the merge with the CdmDataSourceBase
as mentioned in the WrappedCdmDataSource
- therefore two tickts, one for the quick short tine solution another one for the longer taks.
Updated by Andreas Müller over 1 year ago
- Status changed from Feedback to New
- Severity changed from critical to normal