#12 specify CheckoutTimeout as a parameter to getConnection

open
nobody
5
2007-03-27
2007-03-27
Anonymous
No

I use the pool like this:

Connection conn = pool.getConnection();
conn . <execute a single query>
conn.close()

What I would like to do is this:

Connection conn = pool.getConnection(1000);
conn . <execute a single query>
conn.close()

where 1000 is the timeout to wait before obtaining a connection from the pool. Because I am doing a single sql query between each checkout I can effectively have different timeouts depending on the query that I run.
At present I believe I can only set a single default timeout for the whole pool.

This feature would be useful IMO when
1. The pool is maxed out
2. Some calls must complete
3. Other calls are more expendable and can be timed out.

Thanks,

Ben.

ben.riley@ocado.com

Discussion