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 "Knut Anders Hatlen (JIRA)" <ji...@apache.org> on 2010/04/06 10:39:33 UTC

[jira] Created: (DERBY-4607) HeapScan test commits wrong connection

HeapScan test commits wrong connection
--------------------------------------

                 Key: DERBY-4607
                 URL: https://issues.apache.org/jira/browse/DERBY-4607
             Project: Derby
          Issue Type: Bug
          Components: Test
    Affects Versions: 10.6.0.0
            Reporter: Knut Anders Hatlen
            Priority: Minor


The SELECT query in HeapScan is initialized like this:

        select = openDefaultConnection().prepareStatement("SELECT * FROM "+tableName);

The test cases commit the transaction like this:

        getConnection().commit();

openDefaultConnection() opens and returns a new connection to the default database, whereas getConnection() returns a cached default connection, so the two connections are not the same, and the transaction that's being committed is not the executing transaction.


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


[jira] Resolved: (DERBY-4607) HeapScan test commits wrong connection

Posted by "Knut Anders Hatlen (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/DERBY-4607?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Knut Anders Hatlen resolved DERBY-4607.
---------------------------------------

       Resolution: Fixed
    Fix Version/s: 10.6.0.0

Committed revision 931255.

> HeapScan test commits wrong connection
> --------------------------------------
>
>                 Key: DERBY-4607
>                 URL: https://issues.apache.org/jira/browse/DERBY-4607
>             Project: Derby
>          Issue Type: Bug
>          Components: Test
>    Affects Versions: 10.6.0.0
>            Reporter: Knut Anders Hatlen
>            Assignee: Knut Anders Hatlen
>            Priority: Minor
>             Fix For: 10.6.0.0
>
>         Attachments: commit.diff
>
>
> The SELECT query in HeapScan is initialized like this:
>         select = openDefaultConnection().prepareStatement("SELECT * FROM "+tableName);
> The test cases commit the transaction like this:
>         getConnection().commit();
> openDefaultConnection() opens and returns a new connection to the default database, whereas getConnection() returns a cached default connection, so the two connections are not the same, and the transaction that's being committed is not the executing transaction.

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


[jira] Commented: (DERBY-4607) HeapScan test commits wrong connection

Posted by "Knut Anders Hatlen (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/DERBY-4607?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12853831#action_12853831 ] 

Knut Anders Hatlen commented on DERBY-4607:
-------------------------------------------

I plan to post a fix for this issue, but I'll wait until the fix for DERBY-4608 has been committed in order to prevent conflicts (that fix also touches the HeapScan test).

> HeapScan test commits wrong connection
> --------------------------------------
>
>                 Key: DERBY-4607
>                 URL: https://issues.apache.org/jira/browse/DERBY-4607
>             Project: Derby
>          Issue Type: Bug
>          Components: Test
>    Affects Versions: 10.6.0.0
>            Reporter: Knut Anders Hatlen
>            Assignee: Knut Anders Hatlen
>            Priority: Minor
>
> The SELECT query in HeapScan is initialized like this:
>         select = openDefaultConnection().prepareStatement("SELECT * FROM "+tableName);
> The test cases commit the transaction like this:
>         getConnection().commit();
> openDefaultConnection() opens and returns a new connection to the default database, whereas getConnection() returns a cached default connection, so the two connections are not the same, and the transaction that's being committed is not the executing transaction.

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


[jira] Updated: (DERBY-4607) HeapScan test commits wrong connection

Posted by "Knut Anders Hatlen (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/DERBY-4607?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Knut Anders Hatlen updated DERBY-4607:
--------------------------------------

    Attachment: commit.diff

Attached is a patch that makes setUp() initialize the select statement with the helper method BaseJDBCTestCase.prepareStatement() in HeapScan and its sub-class CoveredIdxScan. The helper method uses the getConnection() method to obtain the connection, so now the calls to getConnection().commit() commit on the correct connection. Using the helper method also removes the need to close the statement explicitly in tearDown(). Also, getConnection().commit() was simplified to commit() (helper in BaseJDBCTestCase) which does the same thing.

The patch doesn't appear change the results of the tests in any noticeable way. This is as expected, since there shouldn't be much work required on commit for read-only transactions with read committed isolation level (no log records to flush, and all locks should have been released prior to commit).

> HeapScan test commits wrong connection
> --------------------------------------
>
>                 Key: DERBY-4607
>                 URL: https://issues.apache.org/jira/browse/DERBY-4607
>             Project: Derby
>          Issue Type: Bug
>          Components: Test
>    Affects Versions: 10.6.0.0
>            Reporter: Knut Anders Hatlen
>            Assignee: Knut Anders Hatlen
>            Priority: Minor
>         Attachments: commit.diff
>
>
> The SELECT query in HeapScan is initialized like this:
>         select = openDefaultConnection().prepareStatement("SELECT * FROM "+tableName);
> The test cases commit the transaction like this:
>         getConnection().commit();
> openDefaultConnection() opens and returns a new connection to the default database, whereas getConnection() returns a cached default connection, so the two connections are not the same, and the transaction that's being committed is not the executing transaction.

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


[jira] Assigned: (DERBY-4607) HeapScan test commits wrong connection

Posted by "Knut Anders Hatlen (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/DERBY-4607?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Knut Anders Hatlen reassigned DERBY-4607:
-----------------------------------------

    Assignee: Knut Anders Hatlen

> HeapScan test commits wrong connection
> --------------------------------------
>
>                 Key: DERBY-4607
>                 URL: https://issues.apache.org/jira/browse/DERBY-4607
>             Project: Derby
>          Issue Type: Bug
>          Components: Test
>    Affects Versions: 10.6.0.0
>            Reporter: Knut Anders Hatlen
>            Assignee: Knut Anders Hatlen
>            Priority: Minor
>
> The SELECT query in HeapScan is initialized like this:
>         select = openDefaultConnection().prepareStatement("SELECT * FROM "+tableName);
> The test cases commit the transaction like this:
>         getConnection().commit();
> openDefaultConnection() opens and returns a new connection to the default database, whereas getConnection() returns a cached default connection, so the two connections are not the same, and the transaction that's being committed is not the executing transaction.

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