Received: from maia.hub.org (maia-2.hub.org [200.46.204.251]) by mail.postgresql.org (Postfix) with ESMTP id E6227B5D8BD for ; Thu, 16 Jun 2011 23:20:25 -0300 (ADT) Received: from mail.postgresql.org ([200.46.204.86]) by maia.hub.org (mx1.hub.org [200.46.204.251]) (amavisd-maia, port 10024) with ESMTP id 39622-03 for ; Fri, 17 Jun 2011 02:20:19 +0000 (UTC) X-Greylist: domain auto-whitelisted by SQLgrey-1.7.6 Received: from mail-vw0-f46.google.com (mail-vw0-f46.google.com [209.85.212.46]) by mail.postgresql.org (Postfix) with ESMTP id 8AF09B5D944 for ; Thu, 16 Jun 2011 23:20:19 -0300 (ADT) Received: by vws1 with SMTP id 1so1628806vws.19 for ; Thu, 16 Jun 2011 19:20:19 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:sender:message-id:date:from:user-agent :mime-version:to:subject:references:in-reply-to:content-type :content-transfer-encoding; bh=dqNmcBktd73dEoENxC33+esUR4PgPreZBipDAqFRmao=; b=dXW+oUHOXFJMjQsJ3jnW/umhlSUQDPZKpbNlHHSixu9h6LnkiPI52vVr5GQAOfrE+A pO2dr3g7YIP8xuG/B1QTTJHxFwA+/PZOb4soRos1BDCorQPirB1BiggElDGL/Oi6Sw5U gXnPUEp1mmg1fr7Jm992lMciMhTL3I1fehLHw= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=sender:message-id:date:from:user-agent:mime-version:to:subject :references:in-reply-to:content-type:content-transfer-encoding; b=plzRGcd5NUocm+Z8uGg7QzrGD6Gc8RclWHk4zRL2Ilj1bB8vbaO71KQzddLVB+Tbud kYDuUOOz0YL8CcjnknjZoWVYXEnfqOpVdH3L2yO4o40OfFGzBzphssJI1hYCWgTZiWT/ XzmG/Vsfmm3DjEHnKuBwoLYW+8hUd5waw9IOk= Received: by 10.220.109.169 with SMTP id j41mr638215vcp.49.1308277219672; Thu, 16 Jun 2011 19:20:19 -0700 (PDT) Received: from [192.168.1.12] (pool-71-245-182-40.pitbpa.fios.verizon.net [71.245.182.40]) by mx.google.com with ESMTPS id gi16sm338420vcb.1.2011.06.16.19.20.19 (version=SSLv3 cipher=OTHER); Thu, 16 Jun 2011 19:20:19 -0700 (PDT) Message-ID: <4DFAB9E2.4070905@acm.org> Date: Thu, 16 Jun 2011 22:20:18 -0400 From: Bruce Adams User-Agent: Mozilla/5.0 (X11; U; Linux x86_64; en-US; rv:1.9.2.17) Gecko/20110424 Thunderbird/3.1.10 ThunderBrowse/3.3.5 MIME-Version: 1.0 To: pgsql-jdbc@postgresql.org Subject: Re: Failover Datasource? References: <4DFA5A86.9030301@acm.org> <4DFA671F.2050005@acm.org> <4DFA9704.4000209@hogranch.com> <4DFAB403.5010309@acm.org> <4DFAB5B8.5010603@hogranch.com> In-Reply-To: <4DFAB5B8.5010603@hogranch.com> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit X-Virus-Scanned: Maia Mailguard 1.0.1 X-Spam-Status: No, hits=-1.888 tagged_above=-10 required=5 tests=BAYES_00=-1.9, FREEMAIL_FROM=0.001, RFC_ABUSE_POST=0.001, T_TO_NO_BRKTS_FREEMAIL=0.01 X-Spam-Level: X-Archive-Number: 201106/45 X-Sequence-Number: 21969 Yes, Oracle's JDBC drivers support insanely long JDBC URLs which allow specifying a whole cluster of database servers, what the failover policies are, including various timeouts, load balance weights and more. A single JDBC URL for Oracle can be a thousand characters or more. I suspect the other database vendors (I specifically know about IBM DB2 and MySQL) have followed Oracle's lead here. This page has a simple example: http://programmersjournal.blogspot.com/2008/08/jdbc-connection-string-for-oracle-rac.html On 06/16/2011 10:02 PM, John R Pierce wrote: > On 06/16/11 6:55 PM, Bruce Adams wrote: >> In principal, I agree; in practice, that's not the way it's been done >> in the Java application server world. >> >> I have two readily available Java database connection pool >> implementations available: the one bundled with Apache Tomcat and >> Hibernate's c3p0. Neither of these directly support failover. They >> each expect the lower level JDBC driver to deal with failover. (This >> is true of BEA WebLogic and IBM WebSphere as well, at least as of a >> few years ago when I last used them intensely.) >> >> What I'm looking for is very standard stuff in the Java application >> server world. The JDBC driver handles failover and/or load balancing >> to multiple backend database servers. > > it just seems to me that the individual client drivers shouldn't be > what is tracking the state of the server cluster. I can't imagine > the driver layer could do more than 'try connecting to server 1, if > that fails, try server 2'... if server 1 is dead and not responding, > this is going to be painfully slow and result in minute long TCP > connection timeouts on each connect. > > Do oracle jdbc drivers support this multiple-server notation, same as > shown here earlier for mysql? >