Database Failover Questions
Database Failover Questions
- Subject: Database Failover Questions
- From: email@hidden
- Date: Thu, 21 Oct 2004 10:41:19 -0700
Hi,
I'm working on a database failover mechanism for my WebObjects app, and have
encountered a few hurdles. I've got two database servers--a master and a
slave--and when the primary fails, I would like to switch to the slave. To do
this, I implemented the reconnectionDictionaryForAdaptor method in
EOAdaptor.Delegate. My implementation changes the connectionDictionary in the
EOModel and then writes the updated EOModel back to disk. I also created a
lifebeat that checks the database connection at a regular interval--since it
looks as if reconnectionDictionaryForAdaptor is only called if there is a
problem with an existing connection, and not new connections.
I'm getting a variety of exceptions when the database is switched, even if the
switch occurs at application startup before any sessions are created. Some of
the exceptions include:
com.webobjects.foundation.NSForwardException for java.lang.NullPointerException
at com.webobjects.eoaccess.EORelationship.addJoin(EORelationship.java:1332)
and
com.webobjects.foundation.NSForwardException for java.lang.NullPointerException
at com.webobjects.eoaccess.EOModel.createPrototypeCache(EOModel.java:594)
I'm supposing that I need to invalidate objects, or perhaps create a new
EOObjectStore after the change? Is there some way to do this without restarting
the instances? I would even be ok with terminating all of the sessions, since
this is only failover code and shouldn't be a common occurance. I just don't
want to toggle instances to switch databases.
Anyone deal with a similar experience, or have any advice?
Thanks,
Ian
----------------------------------------------------------------
This message was sent using IMP, the Internet Messaging Program.
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Webobjects-dev mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden