You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@commons.apache.org by "Sébastien Le Ray (JIRA)" <ji...@apache.org> on 2012/09/27 16:24:08 UTC

[jira] [Created] (DBUTILS-101) QueryRunner fails to detect broken pmd

Sébastien Le Ray created DBUTILS-101:
----------------------------------------

             Summary: QueryRunner fails to detect broken pmd
                 Key: DBUTILS-101
                 URL: https://issues.apache.org/jira/browse/DBUTILS-101
             Project: Commons DbUtils
          Issue Type: Improvement
    Affects Versions: 1.5
            Reporter: Sébastien Le Ray
            Priority: Minor


I recently fall across a strange issue with SQLServer JDBC driver and DBUtils. PreparedStatement#getParameterMetadata sometimes throw an SQLException which is not caught in fillParameter.
The issues arises with pagination queries like
SELECT * FROM ( SELECT ROW_NUMBER() OVER ( ORDER BY field1 ASC) AS RowNum,  field1 as id, field2 as reference FROM MY_TABLE WHERE 1 = 1  AND field1 LIKE ?) as toPaginate WHERE RowNum >= 1 AND RowNum <= 50
the query is fine but getParameterMetaData throw an esception complaining about a syntax error near WHERE. Passing pmdKnownBroken to true solves this but stmt.getParameterMetaData(); should be wrapped to catch the exception to adjust pmdKnownBroken.


--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira

[jira] [Commented] (DBUTILS-101) QueryRunner fails to detect broken pmd

Posted by "William R. Speirs (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/DBUTILS-101?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13467022#comment-13467022 ] 

William R. Speirs commented on DBUTILS-101:
-------------------------------------------

Not that I know of. However, you can start one here: http://wiki.apache.org/commons/DbUtils

The param meta data stuff is weird as I've noticed issues with some calls via SQLServer and not others, so tracking it down can sometimes be a pain. It is however almost always the first thing I try when I get a weird/unexpected error.
                
> QueryRunner fails to detect broken pmd
> --------------------------------------
>
>                 Key: DBUTILS-101
>                 URL: https://issues.apache.org/jira/browse/DBUTILS-101
>             Project: Commons DbUtils
>          Issue Type: Improvement
>    Affects Versions: 1.5
>            Reporter: Sébastien Le Ray
>            Priority: Minor
>   Original Estimate: 10m
>  Remaining Estimate: 10m
>
> I recently fall across a strange issue with SQLServer JDBC driver and DBUtils. PreparedStatement#getParameterMetadata sometimes throw an SQLException which is not caught in fillParameter.
> The issue arises with pagination queries like
> SELECT * FROM ( SELECT ROW_NUMBER() OVER ( ORDER BY field1 ASC) AS RowNum,  field1 as id, field2 as reference FROM MY_TABLE WHERE 1 = 1  AND field1 LIKE ?) as toPaginate WHERE RowNum >= 1 AND RowNum <= 50
> the query is fine but getParameterMetaData throw an exception complaining about a syntax error near WHERE. Passing pmdKnownBroken to true solves this but stmt.getParameterMetaData(); should be wrapped to catch the exception to adjust pmdKnownBroken.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira

[jira] [Updated] (DBUTILS-101) QueryRunner fails to detect broken pmd

Posted by "Sébastien Le Ray (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/DBUTILS-101?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Sébastien Le Ray updated DBUTILS-101:
-------------------------------------

    Description: 
I recently fall across a strange issue with SQLServer JDBC driver and DBUtils. PreparedStatement#getParameterMetadata sometimes throw an SQLException which is not caught in fillParameter.
The issue arises with pagination queries like
SELECT * FROM ( SELECT ROW_NUMBER() OVER ( ORDER BY field1 ASC) AS RowNum,  field1 as id, field2 as reference FROM MY_TABLE WHERE 1 = 1  AND field1 LIKE ?) as toPaginate WHERE RowNum >= 1 AND RowNum <= 50
the query is fine but getParameterMetaData throw an exception complaining about a syntax error near WHERE. Passing pmdKnownBroken to true solves this but stmt.getParameterMetaData(); should be wrapped to catch the exception to adjust pmdKnownBroken.


  was:
I recently fall across a strange issue with SQLServer JDBC driver and DBUtils. PreparedStatement#getParameterMetadata sometimes throw an SQLException which is not caught in fillParameter.
The issues arises with pagination queries like
SELECT * FROM ( SELECT ROW_NUMBER() OVER ( ORDER BY field1 ASC) AS RowNum,  field1 as id, field2 as reference FROM MY_TABLE WHERE 1 = 1  AND field1 LIKE ?) as toPaginate WHERE RowNum >= 1 AND RowNum <= 50
the query is fine but getParameterMetaData throw an esception complaining about a syntax error near WHERE. Passing pmdKnownBroken to true solves this but stmt.getParameterMetaData(); should be wrapped to catch the exception to adjust pmdKnownBroken.


    
> QueryRunner fails to detect broken pmd
> --------------------------------------
>
>                 Key: DBUTILS-101
>                 URL: https://issues.apache.org/jira/browse/DBUTILS-101
>             Project: Commons DbUtils
>          Issue Type: Improvement
>    Affects Versions: 1.5
>            Reporter: Sébastien Le Ray
>            Priority: Minor
>   Original Estimate: 10m
>  Remaining Estimate: 10m
>
> I recently fall across a strange issue with SQLServer JDBC driver and DBUtils. PreparedStatement#getParameterMetadata sometimes throw an SQLException which is not caught in fillParameter.
> The issue arises with pagination queries like
> SELECT * FROM ( SELECT ROW_NUMBER() OVER ( ORDER BY field1 ASC) AS RowNum,  field1 as id, field2 as reference FROM MY_TABLE WHERE 1 = 1  AND field1 LIKE ?) as toPaginate WHERE RowNum >= 1 AND RowNum <= 50
> the query is fine but getParameterMetaData throw an exception complaining about a syntax error near WHERE. Passing pmdKnownBroken to true solves this but stmt.getParameterMetaData(); should be wrapped to catch the exception to adjust pmdKnownBroken.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira

[jira] [Closed] (DBUTILS-101) QueryRunner fails to detect broken pmd

Posted by "William R. Speirs (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/DBUTILS-101?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

William R. Speirs closed DBUTILS-101.
-------------------------------------

    Resolution: Not A Problem
    
> QueryRunner fails to detect broken pmd
> --------------------------------------
>
>                 Key: DBUTILS-101
>                 URL: https://issues.apache.org/jira/browse/DBUTILS-101
>             Project: Commons DbUtils
>          Issue Type: Improvement
>    Affects Versions: 1.5
>            Reporter: Sébastien Le Ray
>            Priority: Minor
>   Original Estimate: 10m
>  Remaining Estimate: 10m
>
> I recently fall across a strange issue with SQLServer JDBC driver and DBUtils. PreparedStatement#getParameterMetadata sometimes throw an SQLException which is not caught in fillParameter.
> The issue arises with pagination queries like
> SELECT * FROM ( SELECT ROW_NUMBER() OVER ( ORDER BY field1 ASC) AS RowNum,  field1 as id, field2 as reference FROM MY_TABLE WHERE 1 = 1  AND field1 LIKE ?) as toPaginate WHERE RowNum >= 1 AND RowNum <= 50
> the query is fine but getParameterMetaData throw an exception complaining about a syntax error near WHERE. Passing pmdKnownBroken to true solves this but stmt.getParameterMetaData(); should be wrapped to catch the exception to adjust pmdKnownBroken.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira

[jira] [Commented] (DBUTILS-101) QueryRunner fails to detect broken pmd

Posted by "Sébastien Le Ray (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/DBUTILS-101?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13466692#comment-13466692 ] 

Sébastien Le Ray commented on DBUTILS-101:
------------------------------------------

This is indeed an SQLException… Didn't even thought about the "actually broken" WHERE clause, sorry.
Is there a list of known broken drivers ?
                
> QueryRunner fails to detect broken pmd
> --------------------------------------
>
>                 Key: DBUTILS-101
>                 URL: https://issues.apache.org/jira/browse/DBUTILS-101
>             Project: Commons DbUtils
>          Issue Type: Improvement
>    Affects Versions: 1.5
>            Reporter: Sébastien Le Ray
>            Priority: Minor
>   Original Estimate: 10m
>  Remaining Estimate: 10m
>
> I recently fall across a strange issue with SQLServer JDBC driver and DBUtils. PreparedStatement#getParameterMetadata sometimes throw an SQLException which is not caught in fillParameter.
> The issue arises with pagination queries like
> SELECT * FROM ( SELECT ROW_NUMBER() OVER ( ORDER BY field1 ASC) AS RowNum,  field1 as id, field2 as reference FROM MY_TABLE WHERE 1 = 1  AND field1 LIKE ?) as toPaginate WHERE RowNum >= 1 AND RowNum <= 50
> the query is fine but getParameterMetaData throw an exception complaining about a syntax error near WHERE. Passing pmdKnownBroken to true solves this but stmt.getParameterMetaData(); should be wrapped to catch the exception to adjust pmdKnownBroken.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira

[jira] [Commented] (DBUTILS-101) QueryRunner fails to detect broken pmd

Posted by "William R. Speirs (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/DBUTILS-101?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13466606#comment-13466606 ] 

William R. Speirs commented on DBUTILS-101:
-------------------------------------------

What is the exception? If it's simply an SQLException, then how can DBUtils distinguish between a where clause that is invalid and one where the pmdKnownBroken might just need adjusting?
                
> QueryRunner fails to detect broken pmd
> --------------------------------------
>
>                 Key: DBUTILS-101
>                 URL: https://issues.apache.org/jira/browse/DBUTILS-101
>             Project: Commons DbUtils
>          Issue Type: Improvement
>    Affects Versions: 1.5
>            Reporter: Sébastien Le Ray
>            Priority: Minor
>   Original Estimate: 10m
>  Remaining Estimate: 10m
>
> I recently fall across a strange issue with SQLServer JDBC driver and DBUtils. PreparedStatement#getParameterMetadata sometimes throw an SQLException which is not caught in fillParameter.
> The issue arises with pagination queries like
> SELECT * FROM ( SELECT ROW_NUMBER() OVER ( ORDER BY field1 ASC) AS RowNum,  field1 as id, field2 as reference FROM MY_TABLE WHERE 1 = 1  AND field1 LIKE ?) as toPaginate WHERE RowNum >= 1 AND RowNum <= 50
> the query is fine but getParameterMetaData throw an exception complaining about a syntax error near WHERE. Passing pmdKnownBroken to true solves this but stmt.getParameterMetaData(); should be wrapped to catch the exception to adjust pmdKnownBroken.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira