Quantcast

How to configure unbounded connection pool in DataSource?

classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate
star

How to configure unbounded connection pool in DataSource?

themarchoffolly
Hi, is it possible to configure an unbounded connection pool in the DataSource? The MySQL docs indicate that setting maxsize=0 would create an unbounded connection pool. I can't find any evidence of a maxsize property in the DataSource DSL. From my testing here setting maxActive=0 does not result in an unbounded connection pool, in this case the size of the pool seems to be determined by the initialSize property.

And more generally with a connection pool, is there any way in a Grails app to determine the maximum number of pooled connections used following a run of a set of tests?

Thanks,
David

--
"When we remember we are all mad, the mysteries disappear and life stands explained." ~Twain

Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate
star

Re: How to configure unbounded connection pool in DataSource?

themarchoffolly
In answer to my own question on the off chance it might be helpful to someone else at some point in time, to create a connection pool of unbounded size you simply have to set a negative value for the maxActive=-1 property:

dataSource {
pooled = true
driverClassName = "com.mysql.jdbc.Driver"
username = "admin"
password = "s3cret"
properties {
            maxActive = -1
            maxIdle = 20
            minIdle = 10
            initialSize = 10
}
}

David

On Wed, Oct 19, 2011 at 10:02 PM, David Russell <[hidden email]> wrote:
Hi, is it possible to configure an unbounded connection pool in the DataSource? The MySQL docs indicate that setting maxsize=0 would create an unbounded connection pool. I can't find any evidence of a maxsize property in the DataSource DSL. From my testing here setting maxActive=0 does not result in an unbounded connection pool, in this case the size of the pool seems to be determined by the initialSize property.

And more generally with a connection pool, is there any way in a Grails app to determine the maximum number of pooled connections used following a run of a set of tests?

Thanks,
David

--
"When we remember we are all mad, the mysteries disappear and life stands explained." ~Twain




--
"When we remember we are all mad, the mysteries disappear and life stands explained." ~Twain
Loading...