tomcat-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Bill Davidson <>
Subject Re: Using multiple DataSource's for fail-over.
Date Wed, 02 Sep 2009 15:24:57 GMT
Ognjen Blagojevic wrote:
> IANA-failover-expert, but one question comes to my mind. What happens 
> when the first server is recovered? Some cached connections will still 
> point to second server, while newly created connections will go to the 
> first one?

Actually, it doesn't switch which is the primary.  It keeps trying
the primary every time and failing over to the secondary every
time the primary fails.  When the primary comes back, it will
get the primary.

Basic logic is this:

    conn = primary.getConnection();
}catch ( SQLException e ){
    conn = secondary.getConnection();
return conn;

I'm a little concerned that the first failure might take time
due to having to wait on a timeout or something like that.
That could kill performance, so that's one of the reasons
I'm asking about it here.

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

View raw message