tomcat-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Mark Thomas <>
Subject Re: Query timeout in dbcp
Date Tue, 02 Jun 2009 13:03:11 GMT
S Arvind wrote:
> Hi Martin & Chris,
>   Thing i actually need is, if a query executed from web application then it
> shold not execute more then 22mins. If it execute more then that means query
> shold be cancelled from postgres and java should get exception on this
> event. Is it possible?

If a) your database supports it, b) your JDBC driver supports it and c)
it can be configured in the connection string then yes.

The other option is that you might be able to set it on the connection.
That is a little trickier but not impossible.

Get it working with a non-pooled connection, show us the code and we can
tell you how to get it working with DBCP.


> Thanks,
> Arvind S
> *
> "Many of lifes failure are people who did not realize how close they were to
> success when they gave up."
> -Thomas Edison*
> On Tue, Jun 2, 2009 at 2:40 AM, Christopher Schultz <
>> wrote:
> Arvind,
> On 6/1/2009 3:26 PM, S Arvind wrote:
>>>> Is there any possibility to mention max time a query can execute from
>>>> side?
> What do you want to happen after the timeout? The connection execute*
> method throws an exception? That is going to be very database-specific.
> Martin's response about using removeAbandoned="true" is not going to
> help: this will only remove the connection from the connection pool...
> it won't interfere with its operation in any way.
> Is there some kind of query you can execute on the client side that will
> modify the connection properties? You could make that the
> "validationQuery" for your connection.
> -chris
To unsubscribe, e-mail:
For additional commands, e-mail:

To unsubscribe, e-mail:
For additional commands, e-mail:

View raw message