db-derby-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Dyre Tjeldvoll (JIRA)" <j...@apache.org>
Subject [jira] Commented: (DERBY-3431) DatabaseMetaData.getConnection returns the wrong connection when using connection pooling
Date Wed, 09 Apr 2008 14:12:24 GMT

    [ https://issues.apache.org/jira/browse/DERBY-3431?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12587203#action_12587203

Dyre Tjeldvoll commented on DERBY-3431:

I've been thinking a bit about how best to address this issue. As far as I can see there are
3 different ways of solving this:

1) Let LogicalConnection.createStatement() (and perhaps prepareStatement and similar methods)
overwrite the connection_ variable inside Statement with a reference to itself (a LogicalConnection).
This has the disadvantage of changing an internal member variable that is used for, among
other things, synchronization.

2) Create a new member variable (logicalConnection_) which normally is null, but is set to
point to the LogicalConnection which created the statement (if a LogicalConnection was used)

3) Force all use of Statements to use a LogicalStatement whenever connection pooling is used
(even when statement pooling is not enabled). This would make the code more uniform, but adds
an unnecessary level of indirection when statement caching is not used.


> DatabaseMetaData.getConnection returns the wrong connection when using connection pooling
> -----------------------------------------------------------------------------------------
>                 Key: DERBY-3431
>                 URL: https://issues.apache.org/jira/browse/DERBY-3431
>             Project: Derby
>          Issue Type: Bug
>          Components: JDBC, Network Client
>    Affects Versions:,,,
>         Environment: Client-server with connection pooling enabled.
>            Reporter: Kristian Waagan
>            Priority: Minor
>         Attachments: derby-3431-1a-test_repro.diff
> The connection returned from DatabaseMetaData.getConnection is not the same as the connection
used to create the meta data object when the client driver is used with connection pooling
> For trunk, the embedded driver/ds does the right thing.

This message is automatically generated by JIRA.
You can reply to this email to add a comment to the issue online.

View raw message