Re: JDBC-Pool: Reconnect the connection upon failures; retry queries; etc.

2014-06-19 Thread Miroslav Nachev
Hi Chris,

There are 2 cases:

   - When we try to execute some statement and the connection is lost, we
   would like to retry some times, to show Popup Window to the client with
   notification, etc.
   - We have application, which depends on another database application. If
   the connection to Database is lost, then all applications must be shutdown.
   - All this problems, retries, etc., should be logged.



Miro.


On Thu, Jun 19, 2014 at 5:14 PM, Christopher Schultz <
ch...@christopherschultz.net> wrote:

> -BEGIN PGP SIGNED MESSAGE-
> Hash: SHA256
>
> Miro,
>
> On 6/19/14, 9:42 AM, Miroslav Nachev wrote:
> > Is it possible to configure JDBC-Pool for the following
> > functionality or I need to write my own interceptors and
> > Validator?
> >
> > - Retry N times to getConnection() for OnBorrow/OnConnect and
> > WhileIdle; - Wait X ms between each Retry.
>
> Why would you want to throttle reconnects?
>
> Usually this kind of thing is supported by your JDBC driver for things
> like failover, etc.
>
> - -chris
> -BEGIN PGP SIGNATURE-
> Version: GnuPG v1
> Comment: GPGTools - http://gpgtools.org
> Comment: Using GnuPG with Thunderbird - http://www.enigmail.net/
>
> iQIcBAEBCAAGBQJTovBHAAoJEBzwKT+lPKRYDbUQAJ77mRkG7AN38FR102n7Lddn
> FTnjnsH5FHgY5uVImi71IEcsMssKqe4bAbEVqfcTz2iZBUMhbHpe2Ik4iehJ2YOi
> R+xH60DLVjjHi0Mmb80VmuRLEp7E8dVj/bCiAGwmo3kFCNCsxXjdsN4V/1YR4cJA
> o9HIV62uUgAlhSd4SRsthP0WbjXmTX0U5h+F2tCl29MkqwL8Fn/OXnWRqd1/FuQk
> 88u7dryQU4TZXSSioLLgNGdFRRNIdV5PZeqRA2hTylCjy2GFfCqG4IIIRRgsh32z
> qUY627wksT+1hC6RQ3d6h551St1a1PFr82zgCvytKuoWL30yQFX7bc0lfr+fd18i
> Vny3gN/OxDNIqBFmeedGT76Yf6k3UdKgtUeJ3SLDo0zWq7CUA/BYgaTz+Lgw8J2m
> eKp/QfY18rgLFZg6c+W5vRxl1w9Pd3R30J+8Y28ZuU5xgYjF98hFxuEv2Oo+VqI7
> 4mH31uA4wVppx49L/xdR5eXL9w6HZuZlqiyAbdExv/aj4KvhNtYOyWMq8z+sg9Jr
> KWMApBRnjJU1rIgZpUFWqVlbtJWFs7TAB270aa+445xbbOUDSRlanzNKpoIuRtxT
> R3d+h6j6Onhqmx7DpeuMWOoJzG8UMOHYfezE++ZqM6lzGTQJxbyt30mKFSHgIR1A
> vBY8ZJdn8wNBL9EIK/a4
> =LXZC
> -END PGP SIGNATURE-
>
> -
> To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
> For additional commands, e-mail: users-h...@tomcat.apache.org
>
>


Re: JDBC-Pool: Reconnect the connection upon failures; retry queries; etc.

2014-06-19 Thread Christopher Schultz
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA256

Miro,

On 6/19/14, 9:42 AM, Miroslav Nachev wrote:
> Is it possible to configure JDBC-Pool for the following
> functionality or I need to write my own interceptors and
> Validator?
> 
> - Retry N times to getConnection() for OnBorrow/OnConnect and
> WhileIdle; - Wait X ms between each Retry.

Why would you want to throttle reconnects?

Usually this kind of thing is supported by your JDBC driver for things
like failover, etc.

- -chris
-BEGIN PGP SIGNATURE-
Version: GnuPG v1
Comment: GPGTools - http://gpgtools.org
Comment: Using GnuPG with Thunderbird - http://www.enigmail.net/

iQIcBAEBCAAGBQJTovBHAAoJEBzwKT+lPKRYDbUQAJ77mRkG7AN38FR102n7Lddn
FTnjnsH5FHgY5uVImi71IEcsMssKqe4bAbEVqfcTz2iZBUMhbHpe2Ik4iehJ2YOi
R+xH60DLVjjHi0Mmb80VmuRLEp7E8dVj/bCiAGwmo3kFCNCsxXjdsN4V/1YR4cJA
o9HIV62uUgAlhSd4SRsthP0WbjXmTX0U5h+F2tCl29MkqwL8Fn/OXnWRqd1/FuQk
88u7dryQU4TZXSSioLLgNGdFRRNIdV5PZeqRA2hTylCjy2GFfCqG4IIIRRgsh32z
qUY627wksT+1hC6RQ3d6h551St1a1PFr82zgCvytKuoWL30yQFX7bc0lfr+fd18i
Vny3gN/OxDNIqBFmeedGT76Yf6k3UdKgtUeJ3SLDo0zWq7CUA/BYgaTz+Lgw8J2m
eKp/QfY18rgLFZg6c+W5vRxl1w9Pd3R30J+8Y28ZuU5xgYjF98hFxuEv2Oo+VqI7
4mH31uA4wVppx49L/xdR5eXL9w6HZuZlqiyAbdExv/aj4KvhNtYOyWMq8z+sg9Jr
KWMApBRnjJU1rIgZpUFWqVlbtJWFs7TAB270aa+445xbbOUDSRlanzNKpoIuRtxT
R3d+h6j6Onhqmx7DpeuMWOoJzG8UMOHYfezE++ZqM6lzGTQJxbyt30mKFSHgIR1A
vBY8ZJdn8wNBL9EIK/a4
=LXZC
-END PGP SIGNATURE-

-
To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
For additional commands, e-mail: users-h...@tomcat.apache.org



JDBC-Pool: Reconnect the connection upon failures; retry queries; etc.

2014-06-19 Thread Miroslav Nachev
Hi All,

Is it possible to configure JDBC-Pool for the following functionality or I
need to write my own interceptors and Validator?

   - Retry N times to getConnection() for OnBorrow/OnConnect and WhileIdle;
   - Wait X ms between each Retry.

Are there any examples?


Regards,
Miro.