You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@jackrabbit.apache.org by "Jukka Zitting (Created) (JIRA)" <ji...@apache.org> on 2011/10/02 22:55:33 UTC

[jira] [Created] (JCR-3090) setFetchSize() fails in getAllNodeIds()

setFetchSize() fails in getAllNodeIds()
---------------------------------------

                 Key: JCR-3090
                 URL: https://issues.apache.org/jira/browse/JCR-3090
             Project: Jackrabbit Content Repository
          Issue Type: Bug
            Reporter: Jukka Zitting
            Priority: Minor


I get the following exception from the PersistenceManagerIteratorTest on Windows:

org.apache.jackrabbit.core.state.ItemStateException: getAllNodeIds failed.
        at org.apache.jackrabbit.core.persistence.pool.BundleDbPersistenceManager.getAllNodeIds(BundleDbPersistenceManager.java:1043)
        at org.apache.jackrabbit.core.data.PersistenceManagerIteratorTest.testGetAllNodeIds(PersistenceManagerIteratorTest.java:106)
Caused by: java.sql.SQLException: Invalid parameter value '10'000' for Statement.setFetchSize(int rows).
        at org.apache.derby.impl.jdbc.SQLExceptionFactory40.getSQLException(Unknown Source)
        at org.apache.derby.impl.jdbc.Util.newEmbedSQLException(Unknown Source)
        at org.apache.derby.impl.jdbc.Util.newEmbedSQLException(Unknown Source)
        at org.apache.derby.impl.jdbc.Util.generateCsSQLException(Unknown Source)
        at org.apache.derby.impl.jdbc.EmbedConnection.newSQLException(Unknown Source)
        at org.apache.derby.impl.jdbc.ConnectionChild.newSQLException(Unknown Source)
        at org.apache.derby.impl.jdbc.EmbedStatement.setFetchSize(Unknown Source)
        at org.apache.commons.dbcp.DelegatingStatement.setFetchSize(DelegatingStatement.java:279)
        at org.apache.commons.dbcp.DelegatingStatement.setFetchSize(DelegatingStatement.java:279)
        at org.apache.jackrabbit.core.util.db.ConnectionHelper.reallyExec(ConnectionHelper.java:372)
        at org.apache.jackrabbit.core.util.db.ConnectionHelper$3.call(ConnectionHelper.java:353)
        at org.apache.jackrabbit.core.util.db.ConnectionHelper$3.call(ConnectionHelper.java:349)
        at org.apache.jackrabbit.core.util.db.ConnectionHelper$RetryManager.doTry(ConnectionHelper.java:472)
        at org.apache.jackrabbit.core.util.db.ConnectionHelper.exec(ConnectionHelper.java:349)
        at org.apache.jackrabbit.core.persistence.pool.BundleDbPersistenceManager.getAllNodeIds(BundleDbPersistenceManager.java:1020)

It's caused by the following code in ConnectionHelper when 0 < maxRows < 10000:

            stmt.setMaxRows(maxRows);
            stmt.setFetchSize(10000);

A simple fix would be:


            stmt.setMaxRows(maxRows);
            stmt.setFetchSize(Math.min(10000, maxRows));


--
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] (JCR-3090) setFetchSize() fails in getAllNodeIds()

Posted by "Danilo Ghirardelli (Commented) (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/JCR-3090?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13119963#comment-13119963 ] 

Danilo Ghirardelli commented on JCR-3090:
-----------------------------------------

It seems that every call to the "reallyExec" method have a 0 as the value passed for maxRows. This means that the setFetchSize hint is always disable, and I think this will re-open JCR-2832.

                
> setFetchSize() fails in getAllNodeIds()
> ---------------------------------------
>
>                 Key: JCR-3090
>                 URL: https://issues.apache.org/jira/browse/JCR-3090
>             Project: Jackrabbit Content Repository
>          Issue Type: Bug
>            Reporter: Jukka Zitting
>            Assignee: Jukka Zitting
>            Priority: Minor
>             Fix For: 2.3.1
>
>
> I get the following exception from the PersistenceManagerIteratorTest on Windows:
> org.apache.jackrabbit.core.state.ItemStateException: getAllNodeIds failed.
>         at org.apache.jackrabbit.core.persistence.pool.BundleDbPersistenceManager.getAllNodeIds(BundleDbPersistenceManager.java:1043)
>         at org.apache.jackrabbit.core.data.PersistenceManagerIteratorTest.testGetAllNodeIds(PersistenceManagerIteratorTest.java:106)
> Caused by: java.sql.SQLException: Invalid parameter value '10'000' for Statement.setFetchSize(int rows).
>         at org.apache.derby.impl.jdbc.SQLExceptionFactory40.getSQLException(Unknown Source)
>         at org.apache.derby.impl.jdbc.Util.newEmbedSQLException(Unknown Source)
>         at org.apache.derby.impl.jdbc.Util.newEmbedSQLException(Unknown Source)
>         at org.apache.derby.impl.jdbc.Util.generateCsSQLException(Unknown Source)
>         at org.apache.derby.impl.jdbc.EmbedConnection.newSQLException(Unknown Source)
>         at org.apache.derby.impl.jdbc.ConnectionChild.newSQLException(Unknown Source)
>         at org.apache.derby.impl.jdbc.EmbedStatement.setFetchSize(Unknown Source)
>         at org.apache.commons.dbcp.DelegatingStatement.setFetchSize(DelegatingStatement.java:279)
>         at org.apache.commons.dbcp.DelegatingStatement.setFetchSize(DelegatingStatement.java:279)
>         at org.apache.jackrabbit.core.util.db.ConnectionHelper.reallyExec(ConnectionHelper.java:372)
>         at org.apache.jackrabbit.core.util.db.ConnectionHelper$3.call(ConnectionHelper.java:353)
>         at org.apache.jackrabbit.core.util.db.ConnectionHelper$3.call(ConnectionHelper.java:349)
>         at org.apache.jackrabbit.core.util.db.ConnectionHelper$RetryManager.doTry(ConnectionHelper.java:472)
>         at org.apache.jackrabbit.core.util.db.ConnectionHelper.exec(ConnectionHelper.java:349)
>         at org.apache.jackrabbit.core.persistence.pool.BundleDbPersistenceManager.getAllNodeIds(BundleDbPersistenceManager.java:1020)
> It's caused by the following code in ConnectionHelper when 0 < maxRows < 10000:
>             stmt.setMaxRows(maxRows);
>             stmt.setFetchSize(10000);
> A simple fix would be:
>             stmt.setMaxRows(maxRows);
>             stmt.setFetchSize(Math.min(10000, maxRows));

--
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] (JCR-3090) setFetchSize() fails in getAllNodeIds()

Posted by "Jukka Zitting (Commented) (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/JCR-3090?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13120363#comment-13120363 ] 

Jukka Zitting commented on JCR-3090:
------------------------------------

Good catch about the maxRows == 0 case. I fixed that in revision 1178892.
                
> setFetchSize() fails in getAllNodeIds()
> ---------------------------------------
>
>                 Key: JCR-3090
>                 URL: https://issues.apache.org/jira/browse/JCR-3090
>             Project: Jackrabbit Content Repository
>          Issue Type: Bug
>            Reporter: Jukka Zitting
>            Assignee: Jukka Zitting
>            Priority: Minor
>             Fix For: 2.3.1
>
>
> I get the following exception from the PersistenceManagerIteratorTest on Windows:
> org.apache.jackrabbit.core.state.ItemStateException: getAllNodeIds failed.
>         at org.apache.jackrabbit.core.persistence.pool.BundleDbPersistenceManager.getAllNodeIds(BundleDbPersistenceManager.java:1043)
>         at org.apache.jackrabbit.core.data.PersistenceManagerIteratorTest.testGetAllNodeIds(PersistenceManagerIteratorTest.java:106)
> Caused by: java.sql.SQLException: Invalid parameter value '10'000' for Statement.setFetchSize(int rows).
>         at org.apache.derby.impl.jdbc.SQLExceptionFactory40.getSQLException(Unknown Source)
>         at org.apache.derby.impl.jdbc.Util.newEmbedSQLException(Unknown Source)
>         at org.apache.derby.impl.jdbc.Util.newEmbedSQLException(Unknown Source)
>         at org.apache.derby.impl.jdbc.Util.generateCsSQLException(Unknown Source)
>         at org.apache.derby.impl.jdbc.EmbedConnection.newSQLException(Unknown Source)
>         at org.apache.derby.impl.jdbc.ConnectionChild.newSQLException(Unknown Source)
>         at org.apache.derby.impl.jdbc.EmbedStatement.setFetchSize(Unknown Source)
>         at org.apache.commons.dbcp.DelegatingStatement.setFetchSize(DelegatingStatement.java:279)
>         at org.apache.commons.dbcp.DelegatingStatement.setFetchSize(DelegatingStatement.java:279)
>         at org.apache.jackrabbit.core.util.db.ConnectionHelper.reallyExec(ConnectionHelper.java:372)
>         at org.apache.jackrabbit.core.util.db.ConnectionHelper$3.call(ConnectionHelper.java:353)
>         at org.apache.jackrabbit.core.util.db.ConnectionHelper$3.call(ConnectionHelper.java:349)
>         at org.apache.jackrabbit.core.util.db.ConnectionHelper$RetryManager.doTry(ConnectionHelper.java:472)
>         at org.apache.jackrabbit.core.util.db.ConnectionHelper.exec(ConnectionHelper.java:349)
>         at org.apache.jackrabbit.core.persistence.pool.BundleDbPersistenceManager.getAllNodeIds(BundleDbPersistenceManager.java:1020)
> It's caused by the following code in ConnectionHelper when 0 < maxRows < 10000:
>             stmt.setMaxRows(maxRows);
>             stmt.setFetchSize(10000);
> A simple fix would be:
>             stmt.setMaxRows(maxRows);
>             stmt.setFetchSize(Math.min(10000, maxRows));

--
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] (JCR-3090) setFetchSize() fails in getAllNodeIds()

Posted by "Jukka Zitting (Updated) (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/JCR-3090?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Jukka Zitting updated JCR-3090:
-------------------------------

    Fix Version/s: 2.2.10

Merged to the 2.2 branch in revision 1202178.
                
> setFetchSize() fails in getAllNodeIds()
> ---------------------------------------
>
>                 Key: JCR-3090
>                 URL: https://issues.apache.org/jira/browse/JCR-3090
>             Project: Jackrabbit Content Repository
>          Issue Type: Bug
>            Reporter: Jukka Zitting
>            Assignee: Jukka Zitting
>            Priority: Minor
>             Fix For: 2.2.10, 2.3.1
>
>
> I get the following exception from the PersistenceManagerIteratorTest on Windows:
> org.apache.jackrabbit.core.state.ItemStateException: getAllNodeIds failed.
>         at org.apache.jackrabbit.core.persistence.pool.BundleDbPersistenceManager.getAllNodeIds(BundleDbPersistenceManager.java:1043)
>         at org.apache.jackrabbit.core.data.PersistenceManagerIteratorTest.testGetAllNodeIds(PersistenceManagerIteratorTest.java:106)
> Caused by: java.sql.SQLException: Invalid parameter value '10'000' for Statement.setFetchSize(int rows).
>         at org.apache.derby.impl.jdbc.SQLExceptionFactory40.getSQLException(Unknown Source)
>         at org.apache.derby.impl.jdbc.Util.newEmbedSQLException(Unknown Source)
>         at org.apache.derby.impl.jdbc.Util.newEmbedSQLException(Unknown Source)
>         at org.apache.derby.impl.jdbc.Util.generateCsSQLException(Unknown Source)
>         at org.apache.derby.impl.jdbc.EmbedConnection.newSQLException(Unknown Source)
>         at org.apache.derby.impl.jdbc.ConnectionChild.newSQLException(Unknown Source)
>         at org.apache.derby.impl.jdbc.EmbedStatement.setFetchSize(Unknown Source)
>         at org.apache.commons.dbcp.DelegatingStatement.setFetchSize(DelegatingStatement.java:279)
>         at org.apache.commons.dbcp.DelegatingStatement.setFetchSize(DelegatingStatement.java:279)
>         at org.apache.jackrabbit.core.util.db.ConnectionHelper.reallyExec(ConnectionHelper.java:372)
>         at org.apache.jackrabbit.core.util.db.ConnectionHelper$3.call(ConnectionHelper.java:353)
>         at org.apache.jackrabbit.core.util.db.ConnectionHelper$3.call(ConnectionHelper.java:349)
>         at org.apache.jackrabbit.core.util.db.ConnectionHelper$RetryManager.doTry(ConnectionHelper.java:472)
>         at org.apache.jackrabbit.core.util.db.ConnectionHelper.exec(ConnectionHelper.java:349)
>         at org.apache.jackrabbit.core.persistence.pool.BundleDbPersistenceManager.getAllNodeIds(BundleDbPersistenceManager.java:1020)
> It's caused by the following code in ConnectionHelper when 0 < maxRows < 10000:
>             stmt.setMaxRows(maxRows);
>             stmt.setFetchSize(10000);
> A simple fix would be:
>             stmt.setMaxRows(maxRows);
>             stmt.setFetchSize(Math.min(10000, maxRows));

--
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] (JCR-3090) setFetchSize() fails in getAllNodeIds()

Posted by "Danilo Ghirardelli (Commented) (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/JCR-3090?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13120485#comment-13120485 ] 

Danilo Ghirardelli commented on JCR-3090:
-----------------------------------------

I'm sorry, I wasn't clear. I was not asking for further patch. Please take a look at JCR-2892.
Long story short, both this issue and JCR-2892 (and I suppose a few more) are caused by the explicit value of fetchSize, introduced in JCR-2832 for a postgreSql problem. If you don't set that value at all, the driver will choose the best default and both this issue and JCR-2892 would be immediately solved, but the value was arbitrarily forced to that 10000, which may be good for postgresql but not for other databases.
Possible final solutions are either to make the fetchSize configurable as a parameter in the xml, or to have a few ConnectionHelpers that sets the fetchSize depending on the db (or better, setting it for postgresql and not for any other db), or to try a smaller value (10?) that should be good (although non optimal) for all the databases.
                
> setFetchSize() fails in getAllNodeIds()
> ---------------------------------------
>
>                 Key: JCR-3090
>                 URL: https://issues.apache.org/jira/browse/JCR-3090
>             Project: Jackrabbit Content Repository
>          Issue Type: Bug
>            Reporter: Jukka Zitting
>            Assignee: Jukka Zitting
>            Priority: Minor
>             Fix For: 2.3.1
>
>
> I get the following exception from the PersistenceManagerIteratorTest on Windows:
> org.apache.jackrabbit.core.state.ItemStateException: getAllNodeIds failed.
>         at org.apache.jackrabbit.core.persistence.pool.BundleDbPersistenceManager.getAllNodeIds(BundleDbPersistenceManager.java:1043)
>         at org.apache.jackrabbit.core.data.PersistenceManagerIteratorTest.testGetAllNodeIds(PersistenceManagerIteratorTest.java:106)
> Caused by: java.sql.SQLException: Invalid parameter value '10'000' for Statement.setFetchSize(int rows).
>         at org.apache.derby.impl.jdbc.SQLExceptionFactory40.getSQLException(Unknown Source)
>         at org.apache.derby.impl.jdbc.Util.newEmbedSQLException(Unknown Source)
>         at org.apache.derby.impl.jdbc.Util.newEmbedSQLException(Unknown Source)
>         at org.apache.derby.impl.jdbc.Util.generateCsSQLException(Unknown Source)
>         at org.apache.derby.impl.jdbc.EmbedConnection.newSQLException(Unknown Source)
>         at org.apache.derby.impl.jdbc.ConnectionChild.newSQLException(Unknown Source)
>         at org.apache.derby.impl.jdbc.EmbedStatement.setFetchSize(Unknown Source)
>         at org.apache.commons.dbcp.DelegatingStatement.setFetchSize(DelegatingStatement.java:279)
>         at org.apache.commons.dbcp.DelegatingStatement.setFetchSize(DelegatingStatement.java:279)
>         at org.apache.jackrabbit.core.util.db.ConnectionHelper.reallyExec(ConnectionHelper.java:372)
>         at org.apache.jackrabbit.core.util.db.ConnectionHelper$3.call(ConnectionHelper.java:353)
>         at org.apache.jackrabbit.core.util.db.ConnectionHelper$3.call(ConnectionHelper.java:349)
>         at org.apache.jackrabbit.core.util.db.ConnectionHelper$RetryManager.doTry(ConnectionHelper.java:472)
>         at org.apache.jackrabbit.core.util.db.ConnectionHelper.exec(ConnectionHelper.java:349)
>         at org.apache.jackrabbit.core.persistence.pool.BundleDbPersistenceManager.getAllNodeIds(BundleDbPersistenceManager.java:1020)
> It's caused by the following code in ConnectionHelper when 0 < maxRows < 10000:
>             stmt.setMaxRows(maxRows);
>             stmt.setFetchSize(10000);
> A simple fix would be:
>             stmt.setMaxRows(maxRows);
>             stmt.setFetchSize(Math.min(10000, maxRows));

--
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] [Resolved] (JCR-3090) setFetchSize() fails in getAllNodeIds()

Posted by "Jukka Zitting (Resolved) (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/JCR-3090?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Jukka Zitting resolved JCR-3090.
--------------------------------

       Resolution: Fixed
    Fix Version/s: 2.3.1
         Assignee: Jukka Zitting

Fixed in revision 1178251.
                
> setFetchSize() fails in getAllNodeIds()
> ---------------------------------------
>
>                 Key: JCR-3090
>                 URL: https://issues.apache.org/jira/browse/JCR-3090
>             Project: Jackrabbit Content Repository
>          Issue Type: Bug
>            Reporter: Jukka Zitting
>            Assignee: Jukka Zitting
>            Priority: Minor
>             Fix For: 2.3.1
>
>
> I get the following exception from the PersistenceManagerIteratorTest on Windows:
> org.apache.jackrabbit.core.state.ItemStateException: getAllNodeIds failed.
>         at org.apache.jackrabbit.core.persistence.pool.BundleDbPersistenceManager.getAllNodeIds(BundleDbPersistenceManager.java:1043)
>         at org.apache.jackrabbit.core.data.PersistenceManagerIteratorTest.testGetAllNodeIds(PersistenceManagerIteratorTest.java:106)
> Caused by: java.sql.SQLException: Invalid parameter value '10'000' for Statement.setFetchSize(int rows).
>         at org.apache.derby.impl.jdbc.SQLExceptionFactory40.getSQLException(Unknown Source)
>         at org.apache.derby.impl.jdbc.Util.newEmbedSQLException(Unknown Source)
>         at org.apache.derby.impl.jdbc.Util.newEmbedSQLException(Unknown Source)
>         at org.apache.derby.impl.jdbc.Util.generateCsSQLException(Unknown Source)
>         at org.apache.derby.impl.jdbc.EmbedConnection.newSQLException(Unknown Source)
>         at org.apache.derby.impl.jdbc.ConnectionChild.newSQLException(Unknown Source)
>         at org.apache.derby.impl.jdbc.EmbedStatement.setFetchSize(Unknown Source)
>         at org.apache.commons.dbcp.DelegatingStatement.setFetchSize(DelegatingStatement.java:279)
>         at org.apache.commons.dbcp.DelegatingStatement.setFetchSize(DelegatingStatement.java:279)
>         at org.apache.jackrabbit.core.util.db.ConnectionHelper.reallyExec(ConnectionHelper.java:372)
>         at org.apache.jackrabbit.core.util.db.ConnectionHelper$3.call(ConnectionHelper.java:353)
>         at org.apache.jackrabbit.core.util.db.ConnectionHelper$3.call(ConnectionHelper.java:349)
>         at org.apache.jackrabbit.core.util.db.ConnectionHelper$RetryManager.doTry(ConnectionHelper.java:472)
>         at org.apache.jackrabbit.core.util.db.ConnectionHelper.exec(ConnectionHelper.java:349)
>         at org.apache.jackrabbit.core.persistence.pool.BundleDbPersistenceManager.getAllNodeIds(BundleDbPersistenceManager.java:1020)
> It's caused by the following code in ConnectionHelper when 0 < maxRows < 10000:
>             stmt.setMaxRows(maxRows);
>             stmt.setFetchSize(10000);
> A simple fix would be:
>             stmt.setMaxRows(maxRows);
>             stmt.setFetchSize(Math.min(10000, maxRows));

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