New Posts New Posts RSS Feed: Dynamic Connections
  FAQ FAQ  Forum Search   Calendar   Register Register  Login Login

Dynamic Connections

 Post Reply Post Reply
Author
rclarke View Drop Down
Groupie
Groupie


Joined: 14-Jun-2007
Location: United States
Posts: 69
Post Options Post Options   Quote rclarke Quote  Post ReplyReply Direct Link To This Post Topic: Dynamic Connections
    Posted: 05-Jul-2007 at 6:52am
I want to provide the capability to connect to a different instance of SQL in the event the primary instance is down. This will not be using BOS. In this case there will be a primary server that is normally used. At the end of using the application, a backup (or mirror copy) is made to a backup server or even to the local computer. Upon application start I want to connect first to the primary and if problems exist, prompt the usrer for an alternate SQL Server instance. I know how to get the list of available SQL Server instances but it is not clear to me how to dynamically change the connection string for PM.
 
Thanks in advance,
 
Ron Clarke
Back to Top
jeffdoolittle View Drop Down
Senior Member
Senior Member
Avatar

Joined: 14-Jun-2007
Location: United States
Posts: 146
Post Options Post Options   Quote jeffdoolittle Quote  Post ReplyReply Direct Link To This Post Posted: 05-Jul-2007 at 8:06am
I believe what you want is a DataSourceKeyResolver.  You could have two DataSourceKeys in your ibconfig file, called something like "default_primary" and "default_secondary".  In the Resolver code, you could check for availability of the primary server and use the secondary one in case of an outage.  In the event of a disconnect once you've instantiated your PM, you could also switch over to the other DataSourceKey and therefore the other server.
 
Off the top of my head, I'm not sure whether you can change the DataSourceKey of an instantiated PM, or whether you'd have to start a new one and then copy all your existing changes over. 
Back to Top
 Post Reply Post Reply

Forum Jump Forum Permissions View Drop Down