I have posted a small fix in the jira.

I added the following in SelectQuery.java :
***************************************
        //quick fix : property for setting the jdbc fetch size
        
        protected Integer cursorFetchSize;
        
        /**
        * Gets the JDBC fetch size for this query.
        * @return the fetch size defined for this query, null if not set.
        */
        public Integer getCursorFetchSize()
        {
                return cursorFetchSize;
        }
        
        
        /**
        * Sets the JDBC fetch size for this query.
        * @param cursorFetchSize the desired fetch size, or null to reset it.
        */
        public void setCursorFetchSize(Integer cursorFetchSize)
        {
                this.cursorFetchSize = cursorFetchSize;
        }
        
        //end quick fix
************************************

And modified SelectAction.java to add the check in performAction :
public void performAction(Connection connection, OperationObserver observer)
            throws SQLException, Exception {

        long t1 = System.currentTimeMillis();

        SelectTranslator translator = createTranslator(connection);
        PreparedStatement prepStmt = translator.createStatement();
        
        //quick fix : sets the fetch size       
        if( query.getCursorFetchSize() != null )
                prepStmt.setFetchSize( query.getCursorFetchSize() );
        //quick fix end

        ResultSet rs = prepStmt.executeQuery();
        QueryMetadata md = query.getMetaData(getEntityResolver());

(...)

********************************************************




-- 
View this message in context: 
http://www.nabble.com/Big-selects-on-PostGres-%3A-Configuring-Statement.setFetchSize%28%29-of-a-selectquery-tp23555842p23635409.html
Sent from the Cayenne - User mailing list archive at Nabble.com.

Reply via email to