javax.sql.DataSource.getConnection() implementation in WrappedCdmDataSource does not conform to the interface
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.
#3 Updated by Andreas Müller over 1 year 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.
#4 Updated by Andreas Kohlbecker over 1 year ago
- Assignee changed from Andreas Kohlbecker to Andreas Müller
I Opened the 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.