You are viewing a plain text version of this content. The canonical link for it is here.
Posted to derby-dev@db.apache.org by "Dyre Tjeldvoll (JIRA)" <ji...@apache.org> on 2008/04/09 16:12:24 UTC

[jira] Commented: (DERBY-3431) DatabaseMetaData.getConnection returns the wrong connection when using connection pooling

    [ 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.

Thoughts?

> 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: 10.1.3.1, 10.2.2.0, 10.3.2.1, 10.4.0.0
>         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 enabled.
> 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.