Torque
  1. Torque
  2. TORQUE-141

Adding a way to set JDBC Driver fetchSize on statement

    Details

    • Type: Improvement Improvement
    • Status: Closed
    • Priority: Major Major
    • Resolution: Fixed
    • Affects Version/s: 3.3
    • Fix Version/s: 4.0-beta1
    • Component/s: Runtime, Village
    • Labels:
      None
    • Environment:
      All

      Description

      With the current version, it's not possible to set the fetchsize on statements (see method setFetchSize on Statement) in order to optimize the roundtrips with the database. The default value is set by the JDBC Driver, for Oracle the value is 10.

        Activity

        Hide
        Thomas Fox added a comment -

        Added the property fetchSize to org.apache.torque.criteria.Criteria. The property will be passed to the preparedStatement on queries (assuming that the fetchSize prooperty does not make sense on inserts, updates and deletes)

        Show
        Thomas Fox added a comment - Added the property fetchSize to org.apache.torque.criteria.Criteria. The property will be passed to the preparedStatement on queries (assuming that the fetchSize prooperty does not make sense on inserts, updates and deletes)
        Hide
        GBT added a comment -

        It's possible to set the default fetchsize either by JDBC Driver, either by datasource properties.
        But, it's a default value, that means all my connections will use this default settings.

        If for one particular request, i need to fetch with an other value, i can't do it.
        That's why i need to change this value for specific stattements.

        Show
        GBT added a comment - It's possible to set the default fetchsize either by JDBC Driver, either by datasource properties. But, it's a default value, that means all my connections will use this default settings. If for one particular request, i need to fetch with an other value, i can't do it. That's why i need to change this value for specific stattements.
        Hide
        Thomas Fox added a comment -

        It seems that the default prefetch size can be set on the database connection (http://docs.oracle.com/cd/B10500_01/java.920/a96654/oraperf.htm#1002425). This should be possible by passing connection properties to the pool, see the commons-dbcp docs (http://commons.apache.org/dbcp/configuration.html). Any reason why this does not suffice ?

        Show
        Thomas Fox added a comment - It seems that the default prefetch size can be set on the database connection ( http://docs.oracle.com/cd/B10500_01/java.920/a96654/oraperf.htm#1002425 ). This should be possible by passing connection properties to the pool, see the commons-dbcp docs ( http://commons.apache.org/dbcp/configuration.html ). Any reason why this does not suffice ?
        Hide
        OSC Member added a comment -

        Hi,

        Is there any plan to apply this patch in a future release ?

        Regards

        Show
        OSC Member added a comment - Hi, Is there any plan to apply this patch in a future release ? Regards
        Hide
        GBT added a comment -

        Patch provided

        Show
        GBT added a comment - Patch provided

          People

          • Assignee:
            Thomas Fox
            Reporter:
            GBT
          • Votes:
            1 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved:

              Time Tracking

              Estimated:
              Original Estimate - 24h
              24h
              Remaining:
              Remaining Estimate - 24h
              24h
              Logged:
              Time Spent - Not Specified
              Not Specified

                Development