Atomikos Forum

testQuery not executing

Hi,

thanks to a sniffer I am monitoring the traffic between my applicacion and my database. I need to check the test query is executing but I do not see any traces about it.

my configuration is the following:

setTestQuery("SELECT 1");
setMinPoolSize(15);
setPoolSize(15);
setMaxPoolSize(25);
setMaxIdleTime(120);
setMaintenanceInterval(60);
setReapTimeout(60);


Is there something I am missing? I need this functionality of keep alive in my system and don't know how to proceed

kindest regards
Marta Jimenez Send private email
Wednesday, June 04, 2014
 
 
The testQuery is not for keep alive. Use the maxLifetime setting instead, available as of 3.9

Best
Guy Pardon Send private email
Friday, June 06, 2014
 
 
Hi,

I understand for your answer that if I want the keep alive working I have to use the maxLifeTime property but this property seems to close the connections and after that they are reopened.

I need to configure my pool to send a keep alive (SELECT 1) every x seconds so the firewall doesn't destroy my connections (I want some connections always available).

I thought I could do this with the testQuery but I cannot make it work.

What I am missing?

If the testQuery is not for keep alive, what is it intended for?

kidest regards
mjimen Send private email
Tuesday, June 10, 2014
 
 
Hi,

The testQuery asserts that the connection is still alive before it is being borrowed from the pool. This avoids that getConnection requests return unusable connections.

I suppose we _could_ use the testQuery for periodic liveness checks, but there would be a performance risk: it would have to lock the current pool while issuing N back-end queries. During this time, no getConnection will be able to continue and this can cause application-level freezes.

Of course if you have any hints: we're always looking for ways to do better...

Thanks
Guy Pardon Send private email
Friday, June 13, 2014
 
 

This topic is archived. No further replies will be accepted.

Other recent topics Other recent topics