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 "Rick Hillegas (JIRA)" <ji...@apache.org> on 2011/06/15 22:52:47 UTC

[jira] [Created] (DERBY-5280) Large batch of DDL in a database procedure dies on a transaction severity error.

Large batch of DDL in a database procedure dies on a transaction severity error.
--------------------------------------------------------------------------------

                 Key: DERBY-5280
                 URL: https://issues.apache.org/jira/browse/DERBY-5280
             Project: Derby
          Issue Type: Bug
          Components: SQL
    Affects Versions: 10.8.1.2, 10.9.0.0
            Reporter: Rick Hillegas


The batch of DDL run by the procedure which registers database metadata functions now dies with the following error:

ERROR 40XC0: Dead statement. This may be caused by catching a transaction severity error inside this statement.

A process of binary search shows that this problem was introduced by revision 1086920 as part of the work on DERBY-5161.

The bug can be reproduced by compiling the DBMDWrapper class attached to DERBY-3973 and then running the following script:

connect 'jdbc:derby:memory:db;create=true'; 

create procedure registerPublicStaticMethods( in connectionURL varchar( 200 ), in printSQL boolean )
language java parameter style java modifies sql data
external name 'DBMDWrapper.registerPublicStaticMethods';

call registerPublicStaticMethods( 'jdbc:default:connection', false );

If you change the second argument to registerPublicStaticMethods to true, then you will see all of the DDL being issued by the database procedure. The procedure runs fine in 10.7 but fails with this error in 10.8.

--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] [Commented] (DERBY-5280) Large batch of DDL in a database procedure dies on a transaction severity error.

Posted by "Rick Hillegas (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/DERBY-5280?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13052583#comment-13052583 ] 

Rick Hillegas commented on DERBY-5280:
--------------------------------------

Thanks for looking into this, Knut. +1 to backing out the previous improvement and not over-rotating on a more involved solution at this time. Thanks.

> Large batch of DDL in a database procedure dies on a transaction severity error.
> --------------------------------------------------------------------------------
>
>                 Key: DERBY-5280
>                 URL: https://issues.apache.org/jira/browse/DERBY-5280
>             Project: Derby
>          Issue Type: Bug
>          Components: SQL
>    Affects Versions: 10.8.1.2, 10.9.0.0
>            Reporter: Rick Hillegas
>            Assignee: Knut Anders Hatlen
>         Attachments: junit-repro.diff
>
>
> The batch of DDL run by the procedure which registers database metadata functions now dies with the following error:
> ERROR 40XC0: Dead statement. This may be caused by catching a transaction severity error inside this statement.
> A process of binary search shows that this problem was introduced by revision 1086920 as part of the work on DERBY-5161.
> The bug can be reproduced by compiling the DBMDWrapper class attached to DERBY-3973 and then running the following script:
> connect 'jdbc:derby:memory:db;create=true'; 
> create procedure registerPublicStaticMethods( in connectionURL varchar( 200 ), in printSQL boolean )
> language java parameter style java modifies sql data
> external name 'DBMDWrapper.registerPublicStaticMethods';
> call registerPublicStaticMethods( 'jdbc:default:connection', false );
> If you change the second argument to registerPublicStaticMethods to true, then you will see all of the DDL being issued by the database procedure. The procedure runs fine in 10.7 but fails with this error in 10.8.

--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] [Updated] (DERBY-5280) Large batch of DDL in a database procedure dies on a transaction severity error.

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

Knut Anders Hatlen updated DERBY-5280:
--------------------------------------

    Attachment: d5280.diff

All regression tests ran cleanly with DERBY-5161 backed out. Committed to trunk with revision 1138787.

> Large batch of DDL in a database procedure dies on a transaction severity error.
> --------------------------------------------------------------------------------
>
>                 Key: DERBY-5280
>                 URL: https://issues.apache.org/jira/browse/DERBY-5280
>             Project: Derby
>          Issue Type: Bug
>          Components: SQL
>    Affects Versions: 10.8.1.2, 10.9.0.0
>            Reporter: Rick Hillegas
>            Assignee: Knut Anders Hatlen
>         Attachments: d5280.diff, junit-repro.diff
>
>
> The batch of DDL run by the procedure which registers database metadata functions now dies with the following error:
> ERROR 40XC0: Dead statement. This may be caused by catching a transaction severity error inside this statement.
> A process of binary search shows that this problem was introduced by revision 1086920 as part of the work on DERBY-5161.
> The bug can be reproduced by compiling the DBMDWrapper class attached to DERBY-3973 and then running the following script:
> connect 'jdbc:derby:memory:db;create=true'; 
> create procedure registerPublicStaticMethods( in connectionURL varchar( 200 ), in printSQL boolean )
> language java parameter style java modifies sql data
> external name 'DBMDWrapper.registerPublicStaticMethods';
> call registerPublicStaticMethods( 'jdbc:default:connection', false );
> If you change the second argument to registerPublicStaticMethods to true, then you will see all of the DDL being issued by the database procedure. The procedure runs fine in 10.7 but fails with this error in 10.8.

--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] [Updated] (DERBY-5280) Large batch of DDL in a database procedure dies on a transaction severity error.

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

Knut Anders Hatlen updated DERBY-5280:
--------------------------------------

    Attachment: junit-repro.diff

Attached is a JUnit test case that reproduces the bug.

> Large batch of DDL in a database procedure dies on a transaction severity error.
> --------------------------------------------------------------------------------
>
>                 Key: DERBY-5280
>                 URL: https://issues.apache.org/jira/browse/DERBY-5280
>             Project: Derby
>          Issue Type: Bug
>          Components: SQL
>    Affects Versions: 10.8.1.2, 10.9.0.0
>            Reporter: Rick Hillegas
>         Attachments: junit-repro.diff
>
>
> The batch of DDL run by the procedure which registers database metadata functions now dies with the following error:
> ERROR 40XC0: Dead statement. This may be caused by catching a transaction severity error inside this statement.
> A process of binary search shows that this problem was introduced by revision 1086920 as part of the work on DERBY-5161.
> The bug can be reproduced by compiling the DBMDWrapper class attached to DERBY-3973 and then running the following script:
> connect 'jdbc:derby:memory:db;create=true'; 
> create procedure registerPublicStaticMethods( in connectionURL varchar( 200 ), in printSQL boolean )
> language java parameter style java modifies sql data
> external name 'DBMDWrapper.registerPublicStaticMethods';
> call registerPublicStaticMethods( 'jdbc:default:connection', false );
> If you change the second argument to registerPublicStaticMethods to true, then you will see all of the DDL being issued by the database procedure. The procedure runs fine in 10.7 but fails with this error in 10.8.

--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] [Resolved] (DERBY-5280) Large batch of DDL in a database procedure dies on a transaction severity error.

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

Knut Anders Hatlen resolved DERBY-5280.
---------------------------------------

       Resolution: Fixed
    Fix Version/s: 10.9.0.0
                   10.8.1.5

Committed revision 1138856.

> Large batch of DDL in a database procedure dies on a transaction severity error.
> --------------------------------------------------------------------------------
>
>                 Key: DERBY-5280
>                 URL: https://issues.apache.org/jira/browse/DERBY-5280
>             Project: Derby
>          Issue Type: Bug
>          Components: SQL
>    Affects Versions: 10.8.1.2, 10.9.0.0
>            Reporter: Rick Hillegas
>            Assignee: Knut Anders Hatlen
>             Fix For: 10.8.1.5, 10.9.0.0
>
>         Attachments: d5280.diff, junit-repro.diff
>
>
> The batch of DDL run by the procedure which registers database metadata functions now dies with the following error:
> ERROR 40XC0: Dead statement. This may be caused by catching a transaction severity error inside this statement.
> A process of binary search shows that this problem was introduced by revision 1086920 as part of the work on DERBY-5161.
> The bug can be reproduced by compiling the DBMDWrapper class attached to DERBY-3973 and then running the following script:
> connect 'jdbc:derby:memory:db;create=true'; 
> create procedure registerPublicStaticMethods( in connectionURL varchar( 200 ), in printSQL boolean )
> language java parameter style java modifies sql data
> external name 'DBMDWrapper.registerPublicStaticMethods';
> call registerPublicStaticMethods( 'jdbc:default:connection', false );
> If you change the second argument to registerPublicStaticMethods to true, then you will see all of the DDL being issued by the database procedure. The procedure runs fine in 10.7 but fails with this error in 10.8.

--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] [Issue Comment Edited] (DERBY-5280) Large batch of DDL in a database procedure dies on a transaction severity error.

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

Knut Anders Hatlen edited comment on DERBY-5280 at 6/23/11 12:44 PM:
---------------------------------------------------------------------

Merged fix to 10.8.
Committed revision 1138856.

      was (Author: knutanders):
    Committed revision 1138856.
  
> Large batch of DDL in a database procedure dies on a transaction severity error.
> --------------------------------------------------------------------------------
>
>                 Key: DERBY-5280
>                 URL: https://issues.apache.org/jira/browse/DERBY-5280
>             Project: Derby
>          Issue Type: Bug
>          Components: SQL
>    Affects Versions: 10.8.1.2, 10.9.0.0
>            Reporter: Rick Hillegas
>            Assignee: Knut Anders Hatlen
>             Fix For: 10.8.1.5, 10.9.0.0
>
>         Attachments: d5280.diff, junit-repro.diff
>
>
> The batch of DDL run by the procedure which registers database metadata functions now dies with the following error:
> ERROR 40XC0: Dead statement. This may be caused by catching a transaction severity error inside this statement.
> A process of binary search shows that this problem was introduced by revision 1086920 as part of the work on DERBY-5161.
> The bug can be reproduced by compiling the DBMDWrapper class attached to DERBY-3973 and then running the following script:
> connect 'jdbc:derby:memory:db;create=true'; 
> create procedure registerPublicStaticMethods( in connectionURL varchar( 200 ), in printSQL boolean )
> language java parameter style java modifies sql data
> external name 'DBMDWrapper.registerPublicStaticMethods';
> call registerPublicStaticMethods( 'jdbc:default:connection', false );
> If you change the second argument to registerPublicStaticMethods to true, then you will see all of the DDL being issued by the database procedure. The procedure runs fine in 10.7 but fails with this error in 10.8.

--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] [Assigned] (DERBY-5280) Large batch of DDL in a database procedure dies on a transaction severity error.

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

Knut Anders Hatlen reassigned DERBY-5280:
-----------------------------------------

    Assignee: Knut Anders Hatlen

> Large batch of DDL in a database procedure dies on a transaction severity error.
> --------------------------------------------------------------------------------
>
>                 Key: DERBY-5280
>                 URL: https://issues.apache.org/jira/browse/DERBY-5280
>             Project: Derby
>          Issue Type: Bug
>          Components: SQL
>    Affects Versions: 10.8.1.2, 10.9.0.0
>            Reporter: Rick Hillegas
>            Assignee: Knut Anders Hatlen
>         Attachments: junit-repro.diff
>
>
> The batch of DDL run by the procedure which registers database metadata functions now dies with the following error:
> ERROR 40XC0: Dead statement. This may be caused by catching a transaction severity error inside this statement.
> A process of binary search shows that this problem was introduced by revision 1086920 as part of the work on DERBY-5161.
> The bug can be reproduced by compiling the DBMDWrapper class attached to DERBY-3973 and then running the following script:
> connect 'jdbc:derby:memory:db;create=true'; 
> create procedure registerPublicStaticMethods( in connectionURL varchar( 200 ), in printSQL boolean )
> language java parameter style java modifies sql data
> external name 'DBMDWrapper.registerPublicStaticMethods';
> call registerPublicStaticMethods( 'jdbc:default:connection', false );
> If you change the second argument to registerPublicStaticMethods to true, then you will see all of the DDL being issued by the database procedure. The procedure runs fine in 10.7 but fails with this error in 10.8.

--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] [Commented] (DERBY-5280) Large batch of DDL in a database procedure dies on a transaction severity error.

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

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

If we don't find a better solution, it would probably not do much harm to back out the fix for DERBY-5161. The problem it's supposed to fix shouldn't happen after DERBY-5157.

The stored procedure that gets called in the repro ignores many SQLExceptions that happen during normal operation (typically DROP FUNCTION statements that fail because the function doesn't exist). It looks like the extra cleanup on error that was added in DERBY-5161 somehow kills the parent statement and not only the statement running inside the stored procedure.

> Large batch of DDL in a database procedure dies on a transaction severity error.
> --------------------------------------------------------------------------------
>
>                 Key: DERBY-5280
>                 URL: https://issues.apache.org/jira/browse/DERBY-5280
>             Project: Derby
>          Issue Type: Bug
>          Components: SQL
>    Affects Versions: 10.8.1.2, 10.9.0.0
>            Reporter: Rick Hillegas
>
> The batch of DDL run by the procedure which registers database metadata functions now dies with the following error:
> ERROR 40XC0: Dead statement. This may be caused by catching a transaction severity error inside this statement.
> A process of binary search shows that this problem was introduced by revision 1086920 as part of the work on DERBY-5161.
> The bug can be reproduced by compiling the DBMDWrapper class attached to DERBY-3973 and then running the following script:
> connect 'jdbc:derby:memory:db;create=true'; 
> create procedure registerPublicStaticMethods( in connectionURL varchar( 200 ), in printSQL boolean )
> language java parameter style java modifies sql data
> external name 'DBMDWrapper.registerPublicStaticMethods';
> call registerPublicStaticMethods( 'jdbc:default:connection', false );
> If you change the second argument to registerPublicStaticMethods to true, then you will see all of the DDL being issued by the database procedure. The procedure runs fine in 10.7 but fails with this error in 10.8.

--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] [Closed] (DERBY-5280) Large batch of DDL in a database procedure dies on a transaction severity error.

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

Rick Hillegas closed DERBY-5280.
--------------------------------


Thanks for fixing this, Knut. I have verified that the DDMDWrapper registration procedure now runs cleanly. Closing this issue.

> Large batch of DDL in a database procedure dies on a transaction severity error.
> --------------------------------------------------------------------------------
>
>                 Key: DERBY-5280
>                 URL: https://issues.apache.org/jira/browse/DERBY-5280
>             Project: Derby
>          Issue Type: Bug
>          Components: SQL
>    Affects Versions: 10.8.1.2, 10.9.0.0
>            Reporter: Rick Hillegas
>            Assignee: Knut Anders Hatlen
>             Fix For: 10.8.1.5, 10.9.0.0
>
>         Attachments: d5280.diff, junit-repro.diff
>
>
> The batch of DDL run by the procedure which registers database metadata functions now dies with the following error:
> ERROR 40XC0: Dead statement. This may be caused by catching a transaction severity error inside this statement.
> A process of binary search shows that this problem was introduced by revision 1086920 as part of the work on DERBY-5161.
> The bug can be reproduced by compiling the DBMDWrapper class attached to DERBY-3973 and then running the following script:
> connect 'jdbc:derby:memory:db;create=true'; 
> create procedure registerPublicStaticMethods( in connectionURL varchar( 200 ), in printSQL boolean )
> language java parameter style java modifies sql data
> external name 'DBMDWrapper.registerPublicStaticMethods';
> call registerPublicStaticMethods( 'jdbc:default:connection', false );
> If you change the second argument to registerPublicStaticMethods to true, then you will see all of the DDL being issued by the database procedure. The procedure runs fine in 10.7 but fails with this error in 10.8.

--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] [Commented] (DERBY-5280) Large batch of DDL in a database procedure dies on a transaction severity error.

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

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

The cleanup in DERBY-5161 always pops the right statement context, since it specifies explicitly which context to pop. However, there's a higher-level cleanup that detects statement severity errors and pops the first statement context it finds if there is one. In this case, where we have nested statement contexts, that causes the parent statement context to be popped. I think it's this higher-level cleanup that's missing when preparing an internal statement fails and that caused the problem seen in DERBY-5161.

A proper fix for DERBY-5161 might be to get this higher-level cleanup to kick in somehow also for errors when preparing internal statements, or keeping the low-level cleanup added in DERBY-5161 and making the higher-level detect that cleanup has already happened. However, since DERBY-5161 is believed not to be possible after DERBY-5157, it's probably safer to just back out the fix for DERBY-5161 than trying to devise an even more complex fix for something that's most likely not broken.

> Large batch of DDL in a database procedure dies on a transaction severity error.
> --------------------------------------------------------------------------------
>
>                 Key: DERBY-5280
>                 URL: https://issues.apache.org/jira/browse/DERBY-5280
>             Project: Derby
>          Issue Type: Bug
>          Components: SQL
>    Affects Versions: 10.8.1.2, 10.9.0.0
>            Reporter: Rick Hillegas
>         Attachments: junit-repro.diff
>
>
> The batch of DDL run by the procedure which registers database metadata functions now dies with the following error:
> ERROR 40XC0: Dead statement. This may be caused by catching a transaction severity error inside this statement.
> A process of binary search shows that this problem was introduced by revision 1086920 as part of the work on DERBY-5161.
> The bug can be reproduced by compiling the DBMDWrapper class attached to DERBY-3973 and then running the following script:
> connect 'jdbc:derby:memory:db;create=true'; 
> create procedure registerPublicStaticMethods( in connectionURL varchar( 200 ), in printSQL boolean )
> language java parameter style java modifies sql data
> external name 'DBMDWrapper.registerPublicStaticMethods';
> call registerPublicStaticMethods( 'jdbc:default:connection', false );
> If you change the second argument to registerPublicStaticMethods to true, then you will see all of the DDL being issued by the database procedure. The procedure runs fine in 10.7 but fails with this error in 10.8.

--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira