Project

General

Profile

bug #8170

javax.sql.DataSource.getConnection() implementation in WrappedCdmDataSource does not conform to the interface

Added by Andreas Kohlbecker 5 months ago. Updated 5 months ago.

Status:
Feedback
Priority:
New
Category:
cdmlib
Target version:
Start date:
03/08/2019
Due date:
% Done:

0%

Severity:
critical
Found in Version:

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

Related to Edit - bug #8132: phycobank cdm-server instance problems with db connections New 02/22/2019
Related to Edit - bug #8171: javax.sql.DataSource.getConnection() implementation in WrappedCdmDataSource fails to cache the connection which and leaves it unclosed Closed 03/08/2019

History

#1 Updated by Andreas Kohlbecker 5 months ago

  • Related to bug #8132: phycobank cdm-server instance problems with db connections added

#2 Updated by Andreas Kohlbecker 5 months ago

  • Related to bug #8171: javax.sql.DataSource.getConnection() implementation in WrappedCdmDataSource fails to cache the connection which and leaves it unclosed added

#3 Updated by Andreas Müller 5 months 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 5 months 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.

Also available in: Atom PDF

Add picture from clipboard (Maximum size: 40 MB)