OpenJPA
  1. OpenJPA
  2. OPENJPA-881

Enable connection pooling for testcases.

    Details

    • Type: Improvement Improvement
    • Status: Closed
    • Priority: Major Major
    • Resolution: Fixed
    • Affects Version/s: 1.0.4, 1.1.1, 1.2.1, 1.3.0, 2.0.0-M2
    • Fix Version/s: 1.0.4, 1.2.1, 1.3.0, 2.0.0-M2
    • Component/s: None
    • Labels:
      None

      Description

      Test configurations currently use dbcp with MaxIdle=0, effectively no connection pool. For Derby this doesn't have much of an effect but with other databases, like DB2, setting MaxIdle=2 can dramatically improve the time taken to run the tests.

        Activity

        Hide
        Milosz Tylenda added a comment -

        Mike, we have once discussed it here [1], maybe it's worth re-reading. I run the test suite on various databases and found the below settings quite useful on my system (all databases and OpenJPA are co-located):

        <dbcp.args>MaxActive=100,MaxIdle=10,MaxWait=10000,timeBetweenEvictionRunsMillis=2000,minEvictableIdleTimeMillis=1000</dbcp.args>

        [1] http://n2.nabble.com/Test-suite-slow-on-DB2-td1115993.html#a1115993

        Show
        Milosz Tylenda added a comment - Mike, we have once discussed it here [1] , maybe it's worth re-reading. I run the test suite on various databases and found the below settings quite useful on my system (all databases and OpenJPA are co-located): <dbcp.args>MaxActive=100,MaxIdle=10,MaxWait=10000,timeBetweenEvictionRunsMillis=2000,minEvictableIdleTimeMillis=1000</dbcp.args> [1] http://n2.nabble.com/Test-suite-slow-on-DB2-td1115993.html#a1115993
        Hide
        Michael Dick added a comment -

        Hi Milosz,

        I remember the conversation. All I really wanted to do in this issue is set MaxIdle >=0 so that we maintain at least one connection. Along the way I split out the settings we've used in the past into their own properties.

        I've never messed around with the eviction times but they're easy enough to specify via dbcp.args or I can split them into their own properties too if you'd prefer that.

        Show
        Michael Dick added a comment - Hi Milosz, I remember the conversation. All I really wanted to do in this issue is set MaxIdle >=0 so that we maintain at least one connection. Along the way I split out the settings we've used in the past into their own properties. I've never messed around with the eviction times but they're easy enough to specify via dbcp.args or I can split them into their own properties too if you'd prefer that.
        Hide
        Milosz Tylenda added a comment -

        Mike, I think specifying eviction stuff via dbcp.args is OK.

        Show
        Milosz Tylenda added a comment - Mike, I think specifying eviction stuff via dbcp.args is OK.
        Hide
        Michael Dick added a comment -

        I went ahead and tried adding the properties and ran into an error with commons-dbcp 1.2.1. Upgrading to 1.2.2 resolved the issue. Did you run into the same or similar problems Milosz?

        Show
        Michael Dick added a comment - I went ahead and tried adding the properties and ran into an error with commons-dbcp 1.2.1. Upgrading to 1.2.2 resolved the issue. Did you run into the same or similar problems Milosz?
        Hide
        Milosz Tylenda added a comment -

        No. I run the test suite with the settings mentioned earlier quite often on Linux and sometimes on Windows and can't remember any problems. However, I ran into problems (too many connections, etc.) when I probably didn't specify the eviction properties.

        I haven't tried the latest snapshots though.

        Show
        Milosz Tylenda added a comment - No. I run the test suite with the settings mentioned earlier quite often on Linux and sometimes on Windows and can't remember any problems. However, I ran into problems (too many connections, etc.) when I probably didn't specify the eviction properties. I haven't tried the latest snapshots though.

          People

          • Assignee:
            Michael Dick
            Reporter:
            Michael Dick
          • Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved:

              Development