Project

General

Profile

Actions

bug #8170

open

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

Added by Andreas Kohlbecker over 5 years ago. Updated over 1 year ago.

Status:
New
Priority:
New
Category:
cdmlib
Target version:
Start date:
Due date:
% Done:

0%

Estimated time:
Severity:
normal
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 WorksformeWolf-Henning Kusber

Actions
Related to EDIT - bug #8171: javax.sql.DataSource.getConnection() implementation in WrappedCdmDataSource fails to cache the connection which and leaves it unclosedClosedAndreas Kohlbecker

Actions
Actions #1

Updated by Andreas Kohlbecker over 5 years ago

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

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
Actions #3

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.

Actions #4

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.

Actions #5

Updated by Andreas Müller over 1 year ago

  • Status changed from Feedback to New
  • Severity changed from critical to normal
Actions

Also available in: Atom PDF