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 "Kristian Waagan (JIRA)" <ji...@apache.org> on 2012/04/30 11:34:47 UTC
[jira] [Created] (DERBY-5734) End transaction if
CleanDatabaseTestSetup.decorateSQL fails
Kristian Waagan created DERBY-5734:
--------------------------------------
Summary: End transaction if CleanDatabaseTestSetup.decorateSQL fails
Key: DERBY-5734
URL: https://issues.apache.org/jira/browse/DERBY-5734
Project: Derby
Issue Type: Improvement
Components: Test
Affects Versions: 10.9.0.0
Reporter: Kristian Waagan
Assignee: Kristian Waagan
Priority: Minor
By overriding CleanDatabaseTestSetup.decorateSQL you are allowed to perform tasks as part of the test setup / decorator. The connection obtainable through the passed in statement is configured with auto-commit off. If decorateSQL fails the connection may be left active in the middle of a transaction, which again may cause subsequent tests to fails. I've observed subsequent tests fail due to locks helds by the statement / connection passed to decorateSQL.
CleanDatabaseTestSetup.setUp should ensure the transaction is ended regardless of whether decorateSQL throws an exception or not.
--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira
[jira] [Closed] (DERBY-5734) End transaction if
CleanDatabaseTestSetup.decorateSQL fails
Posted by "Kristian Waagan (JIRA)" <ji...@apache.org>.
[ https://issues.apache.org/jira/browse/DERBY-5734?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Kristian Waagan closed DERBY-5734.
----------------------------------
Resolution: Fixed
Fix Version/s: 10.9.0.0
Issue & fix info: (was: Patch Available)
Committed to trunk with revision 1333360.
Closing issue.
> End transaction if CleanDatabaseTestSetup.decorateSQL fails
> -----------------------------------------------------------
>
> Key: DERBY-5734
> URL: https://issues.apache.org/jira/browse/DERBY-5734
> Project: Derby
> Issue Type: Improvement
> Components: Test
> Affects Versions: 10.9.0.0
> Reporter: Kristian Waagan
> Assignee: Kristian Waagan
> Priority: Minor
> Fix For: 10.9.0.0
>
> Attachments: derby-5734-1a-end_transaction.diff, derby-5734-1b-end_transaction.diff
>
>
> By overriding CleanDatabaseTestSetup.decorateSQL you are allowed to perform tasks as part of the test setup / decorator. The connection obtainable through the passed in statement is configured with auto-commit off. If decorateSQL fails the connection may be left active in the middle of a transaction, which again may cause subsequent tests to fails. I've observed subsequent tests fail due to locks helds by the statement / connection passed to decorateSQL.
> CleanDatabaseTestSetup.setUp should ensure the transaction is ended regardless of whether decorateSQL throws an exception or not.
--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira
[jira] [Updated] (DERBY-5734) End transaction if
CleanDatabaseTestSetup.decorateSQL fails
Posted by "Kristian Waagan (JIRA)" <ji...@apache.org>.
[ https://issues.apache.org/jira/browse/DERBY-5734?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Kristian Waagan updated DERBY-5734:
-----------------------------------
Attachment: derby-5734-1a-end_transaction.diff
Attaching patch 1a, which makes sure the transaction is either committed or rolled back. It doens't guarantee that the connection is closed.
Patch ready for review.
> End transaction if CleanDatabaseTestSetup.decorateSQL fails
> -----------------------------------------------------------
>
> Key: DERBY-5734
> URL: https://issues.apache.org/jira/browse/DERBY-5734
> Project: Derby
> Issue Type: Improvement
> Components: Test
> Affects Versions: 10.9.0.0
> Reporter: Kristian Waagan
> Assignee: Kristian Waagan
> Priority: Minor
> Attachments: derby-5734-1a-end_transaction.diff
>
>
> By overriding CleanDatabaseTestSetup.decorateSQL you are allowed to perform tasks as part of the test setup / decorator. The connection obtainable through the passed in statement is configured with auto-commit off. If decorateSQL fails the connection may be left active in the middle of a transaction, which again may cause subsequent tests to fails. I've observed subsequent tests fail due to locks helds by the statement / connection passed to decorateSQL.
> CleanDatabaseTestSetup.setUp should ensure the transaction is ended regardless of whether decorateSQL throws an exception or not.
--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira
[jira] [Updated] (DERBY-5734) End transaction if
CleanDatabaseTestSetup.decorateSQL fails
Posted by "Kristian Waagan (JIRA)" <ji...@apache.org>.
[ https://issues.apache.org/jira/browse/DERBY-5734?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Kristian Waagan updated DERBY-5734:
-----------------------------------
Attachment: derby-5734-1b-end_transaction.diff
Thanks for looking at the patch, Knut.
I rewrote the logic a little and used clearConnection() (no argument passed) in the finally block.
Regression tests passed.
> End transaction if CleanDatabaseTestSetup.decorateSQL fails
> -----------------------------------------------------------
>
> Key: DERBY-5734
> URL: https://issues.apache.org/jira/browse/DERBY-5734
> Project: Derby
> Issue Type: Improvement
> Components: Test
> Affects Versions: 10.9.0.0
> Reporter: Kristian Waagan
> Assignee: Kristian Waagan
> Priority: Minor
> Attachments: derby-5734-1a-end_transaction.diff, derby-5734-1b-end_transaction.diff
>
>
> By overriding CleanDatabaseTestSetup.decorateSQL you are allowed to perform tasks as part of the test setup / decorator. The connection obtainable through the passed in statement is configured with auto-commit off. If decorateSQL fails the connection may be left active in the middle of a transaction, which again may cause subsequent tests to fails. I've observed subsequent tests fail due to locks helds by the statement / connection passed to decorateSQL.
> CleanDatabaseTestSetup.setUp should ensure the transaction is ended regardless of whether decorateSQL throws an exception or not.
--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira
[jira] [Commented] (DERBY-5734) End transaction if
CleanDatabaseTestSetup.decorateSQL fails
Posted by "Knut Anders Hatlen (JIRA)" <ji...@apache.org>.
[ https://issues.apache.org/jira/browse/DERBY-5734?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13264865#comment-13264865 ]
Knut Anders Hatlen commented on DERBY-5734:
-------------------------------------------
Looks like a useful fix. +1
If you call JDBC.cleanup(conn) or clearConnection(conn) instead, the connection will be closed too. The latter will additionally clear the conn instance variable. But I suppose rollback() would be enough to get the tests going again in most cases.
> End transaction if CleanDatabaseTestSetup.decorateSQL fails
> -----------------------------------------------------------
>
> Key: DERBY-5734
> URL: https://issues.apache.org/jira/browse/DERBY-5734
> Project: Derby
> Issue Type: Improvement
> Components: Test
> Affects Versions: 10.9.0.0
> Reporter: Kristian Waagan
> Assignee: Kristian Waagan
> Priority: Minor
> Attachments: derby-5734-1a-end_transaction.diff
>
>
> By overriding CleanDatabaseTestSetup.decorateSQL you are allowed to perform tasks as part of the test setup / decorator. The connection obtainable through the passed in statement is configured with auto-commit off. If decorateSQL fails the connection may be left active in the middle of a transaction, which again may cause subsequent tests to fails. I've observed subsequent tests fail due to locks helds by the statement / connection passed to decorateSQL.
> CleanDatabaseTestSetup.setUp should ensure the transaction is ended regardless of whether decorateSQL throws an exception or not.
--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira