You are viewing a plain text version of this content. The canonical link for it is here.
Posted to derby-user@db.apache.org by "Fisher, Jonathan" <Jo...@argushealth.com> on 2010/04/19 18:24:18 UTC

Question about replication

I've successfully setup master/slave replication. The admin guide and
previous posts to this list provided value in making this happen. The
guides seem to leave one thing missing... How do you use this in your
code?

If I have a JDBC connection to the host:port, and the host JVM dies, the
slave comes online and begins to process transactions as the master
would.

I'm trying to understand how to make this failover mechanism transparent
to the application... Right now, the app connects to
jdbc:derby://localhost:1527/jmxdb, however, the slave is listening on
jdbc:derby://localhost:1088/jmxdb. The replication is happening over
port 8001, if that matters.

Is there something I can specify in my jdbc url to try the master first,
and if unsuccessful, try the slave? 

Something like:
jdbc:derby://localhost:1527,localhost:1088/jmxdb

Thank you,

Jon


PRIVILEGED AND CONFIDENTIAL
This email transmission contains privileged and confidential information intended only for the use of the individual or entity named above.  If the reader of the email is not the intended recipient or the employee or agent responsible for delivering it to the intended recipient, you are hereby notified that any use, dissemination or copying of this email transmission is strictly prohibited by the sender.  If you have received this transmission in error, please delete the email and immediately notify the sender via the email return address or mailto:postmaster@argushealth.com.  Thank you.





Re: Question about replication

Posted by Brett Wooldridge <br...@gmail.com>.
Jonathan,

Could you open an enhancement for this feature?  MySQL's driver has such an
option (among many others that would be nice), so I think it makes sense as
a feature.

Brett

On Tue, Apr 20, 2010 at 8:34 AM, Dag H. Wanvik <Da...@sun.com> wrote:

> "Fisher, Jonathan" <Jo...@argushealth.com> writes:
>
> > Is there something I can specify in my jdbc url to try the master first,
> > and if unsuccessful, try the slave?
>
> I don't believe there is a transparent failover mechanism in Derby
> yet. You would need to let your client try the slave if the master
> does not respond, as far as I know.
>
> Thanks,
> Dag
>
> > Something like:
> > jdbc:derby://localhost:1527,localhost:1088/jmxdb
>

Re: Question about replication

Posted by "Dag H. Wanvik" <Da...@Sun.COM>.
"Fisher, Jonathan" <Jo...@argushealth.com> writes:

> Is there something I can specify in my jdbc url to try the master first,
> and if unsuccessful, try the slave? 

I don't believe there is a transparent failover mechanism in Derby
yet. You would need to let your client try the slave if the master
does not respond, as far as I know. 

Thanks,
Dag

> Something like:
> jdbc:derby://localhost:1527,localhost:1088/jmxdb