Uploaded image for project: 'Grails'
  1. Grails
  2. GRAILS-7455

Get rid of legacy commons-dbcp or at least simplify different connection pool setup

    Details

    • Type: Improvement Improvement
    • Status: Closed
    • Priority: Major Major
    • Resolution: Fixed
    • Affects Version/s: 1.3.7
    • Fix Version/s: 2.3-M1
    • Component/s: Configuration
    • Labels:
      None

      Description

      I do believe, that grails users shouldn't run into problem like this.
      So, I think, it would be useful to:
      1. Provide a way to configure connection pool other than dbcp in DataSource.groovy not in resource.groovy.
      2. Turn on idle connection eviction by default at least on production environments.
      3. Migrate from legacy dbcp, to modern connection pools (I prefer boncp, but tomcat jdbc-pool is fine too).
      I my opinion, grails 1.4 release is a perfect opportunity to implement such a big changes.

        Issue Links

          Activity

          Hide
          Burt Beckwith added a comment -

          Configuring your own pool is easy - define a "dataSource" bean in resources.groovy with the pool class and whatever properties you want to set.

          Show
          Burt Beckwith added a comment - Configuring your own pool is easy - define a "dataSource" bean in resources.groovy with the pool class and whatever properties you want to set.
          Hide
          Robert McIntosh added a comment -

          I am aware of that, and it seems like a hack. should be able to do it just in the datasource.groovy file, instead the config is spread between two files.

          Show
          Robert McIntosh added a comment - I am aware of that, and it seems like a hack. should be able to do it just in the datasource.groovy file, instead the config is spread between two files.
          Hide
          Kimmo Björnsson added a comment -

          We just upgraded to Grails 2.3.4, to me it seems like "idle connection eviction" is not on by default in production. I don't know if it should be fixed or not.

          From an un-configured production tomcat.

          println "maxAge: ${ctx.dataSource.targetDataSource.targetDataSource.properties.maxAge}"
          println "numTestsPerEvictionRun: ${ctx.dataSource.targetDataSource.targetDataSource.properties.numTestsPerEvictionRun}"
          

          maxAge: 0
          numTestsPerEvictionRun: 0

          Show
          Kimmo Björnsson added a comment - We just upgraded to Grails 2.3.4, to me it seems like "idle connection eviction" is not on by default in production. I don't know if it should be fixed or not. From an un-configured production tomcat. println "maxAge: ${ctx.dataSource.targetDataSource.targetDataSource.properties.maxAge}" println "numTestsPerEvictionRun: ${ctx.dataSource.targetDataSource.targetDataSource.properties.numTestsPerEvictionRun}" maxAge: 0 numTestsPerEvictionRun: 0
          Hide
          Lari Hotari added a comment -

          Kimmo, could you please report a separate jira issue about improving the default settings (like maxAge).
          It looks like some other values (like minEvictableIdleTimeMillis, timeBetweenEvictionRunsMillis) aren't optimal either.

          Show
          Lari Hotari added a comment - Kimmo, could you please report a separate jira issue about improving the default settings (like maxAge). It looks like some other values (like minEvictableIdleTimeMillis, timeBetweenEvictionRunsMillis) aren't optimal either.
          Hide
          Kimmo Björnsson added a comment -

          Created GRAILS-11097 to suggest a better default.

          Show
          Kimmo Björnsson added a comment - Created GRAILS-11097 to suggest a better default.

            People

            • Assignee:
              Burt Beckwith
              Reporter:
              allnightlong
            • Votes:
              1 Vote for this issue
              Watchers:
              5 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved:
                Last Reviewed:

                Development