I am still pretty knew to all this, so forgive me if I am doing somethign
really dumb here, but I was wondering whether this would work.
What if I just change TurbinePoolProkerService so that in the
getConnection() method it first tries getConnection(DEFAULT) until the pool
is empty (i.e. if the max connections per pool i s5, it can try this 5
times) and if all those getCOnnection's throw an exception (which I think
should happen if the first database is down) then it tries
getConnection(SECONDARY).
If the default ConnectionPool realises that it has gone down (i.e. it's pool
is empty and it can't get a New Connection) it can register itself as down,
so that subsequent requests to getConnection will not have to wait for a
ConnectionTimeout before realising there is something wrong. Then when this
DB comes back up a background thread can register it as up again.
I thought that would take care of if the default database comes back up,
because it would always try to connect to the default DB first.
Will this sort of idea work, or am I missing something?
Deborah
P.S. Why do you say that syncing the DB's will be hard? I was planning on
using MySQL's built in replication.
-----Original Message-----
From: Jon Stevens [mailto:[EMAIL PROTECTED]]
Sent: Tuesday, 24 July 2001 2:02 AM
To: Turbine-user
Subject: Re: redundant database
Yup.
Having someone implement this would be great!
Note: sync'ing the two databases is going to be difficult.
You are also going to have problems with telling the difference between a
connection A object which has just had problems getting a connection to
database A and a connection B object which is still connected to database A.
In other words, you may end up with accidentally connecting to the database
B when you didn't really need to. The way around this is to attempt to use
up all of the connections to database A before moving on to database B. You
also need something to "reset" the cache so that when database A comes back
up, it will start using it again. A background thread can deal with that.
-jon
on 7/23/01 2:03 AM, "Kasper Nielsen" <[EMAIL PROTECTED]> wrote:
> Hasn't been done yet.
>
>> From http://jakarta.apache.org/turbine/todo.html (List is out of date)
>
> a.. Add a feature to the connection pool system to allow it to have
multiple
> database fail over so that if all the connections to one database fail, it
> will auto-attempt to connect to a "backup" database.
> Owner: None
>
> You should look at the DB service if you want to do anything.
>
> - Kasper
>
>
> ----- Original Message -----
> From: "Cromer, Deborah" <[EMAIL PROTECTED]>
> To: <[EMAIL PROTECTED]>
> Sent: Monday, July 23, 2001 8:55 AM
> Subject: redundant database
>
>
>> Hi,
>>
>> For my application I am setting up two databases for redundancy. I plan
on
>> having two-way redundancy, using MySQL.
>>
>> I was wondering if there is a way of setting up a seconday database in
>> Turbine so that if the default database is down the secondary one gets
> used.
>>
>> Is something like that already written? Or where should I stick it in
>> myself?
>>
>> Deborah
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]