From user-return-30525-apmail-cassandra-user-archive=cassandra.apache.org@cassandra.apache.org Sun Dec 9 22:06:36 2012 Return-Path: X-Original-To: apmail-cassandra-user-archive@www.apache.org Delivered-To: apmail-cassandra-user-archive@www.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id CF5A2D4E5 for ; Sun, 9 Dec 2012 22:06:36 +0000 (UTC) Received: (qmail 50140 invoked by uid 500); 9 Dec 2012 22:06:34 -0000 Delivered-To: apmail-cassandra-user-archive@cassandra.apache.org Received: (qmail 50105 invoked by uid 500); 9 Dec 2012 22:06:34 -0000 Mailing-List: contact user-help@cassandra.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: user@cassandra.apache.org Delivered-To: mailing list user@cassandra.apache.org Received: (qmail 50096 invoked by uid 99); 9 Dec 2012 22:06:34 -0000 Received: from nike.apache.org (HELO nike.apache.org) (192.87.106.230) by apache.org (qpsmtpd/0.29) with ESMTP; Sun, 09 Dec 2012 22:06:34 +0000 X-ASF-Spam-Status: No, hits=2.2 required=5.0 tests=HTML_MESSAGE,RCVD_IN_DNSWL_NONE,SPF_PASS X-Spam-Check-By: apache.org Received-SPF: pass (nike.apache.org: local policy) Received: from [208.113.200.5] (HELO homiemail-a47.g.dreamhost.com) (208.113.200.5) by apache.org (qpsmtpd/0.29) with ESMTP; Sun, 09 Dec 2012 22:06:27 +0000 Received: from homiemail-a47.g.dreamhost.com (localhost [127.0.0.1]) by homiemail-a47.g.dreamhost.com (Postfix) with ESMTP id 48F6F28405C for ; Sun, 9 Dec 2012 14:06:05 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha1; c=relaxed; d=thelastpickle.com; h=from :content-type:message-id:mime-version:subject:date:references:to :in-reply-to; s=thelastpickle.com; bh=5552jHM+yXe6zVjTuxpifPbe81 M=; b=bSmWu3oDrncZLJIgCQvUqip07bp4U/uektlLcUBxMBLq/yKtgLxrlw4LLd hklcSnyW3MDVftxHmpjwnMCx8LVdLnXJUeGz9nKROQwrVFZJhSaz2Zc3Wy78qrbB EdYqhuM1l2J1RRdvZ6lc1xWEV7J/+iLdax+S+f8qDi3sYFzQg= Received: from [192.168.2.13] (unknown [116.90.132.105]) (using TLSv1 with cipher AES128-SHA (128/128 bits)) (No client certificate requested) (Authenticated sender: aaron@thelastpickle.com) by homiemail-a47.g.dreamhost.com (Postfix) with ESMTPSA id C59D828405B for ; Sun, 9 Dec 2012 14:06:04 -0800 (PST) From: aaron morton Content-Type: multipart/alternative; boundary="Apple-Mail=_54D16873-9832-4B61-97CA-952B7B1F6A56" Message-Id: <04E4FB77-58B0-4045-959C-A460BF682B03@thelastpickle.com> Mime-Version: 1.0 (Mac OS X Mail 6.2 \(1499\)) Subject: Re: JDBC, Pools and clusters ? Date: Mon, 10 Dec 2012 11:06:07 +1300 References: To: user@cassandra.apache.org In-Reply-To: X-Mailer: Apple Mail (2.1499) X-Virus-Checked: Checked by ClamAV on apache.org --Apple-Mail=_54D16873-9832-4B61-97CA-952B7B1F6A56 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset=windows-1252 If you are feeling adventurous this has connection pooling, it will only = work with 1.2 though https://github.com/datastax/java-driver I'm not aware of the current best practice for connecting pooling with = the older JDBC driver. I can see some support for pooling in the trunk = but it does not appear to be in the (current) 1.1.2 branch.=20 Cheers ----------------- Aaron Morton Freelance Cassandra Developer New Zealand @aaronmorton http://www.thelastpickle.com On 10/12/2012, at 3:23 AM, Andy Cobley = wrote: > I'm starting to move to JBC for Cassandra (away from Hector). In = his strange loop 2012 anti-pattern presentation, Mathew Dennis writes: >=20 > "Sometimes people try to restrict clients to a single node. This = actually takes work, and causes problems. Don=92t do it." >=20 > Now, I note that the JDBC pooled connection class takes a single node = as an argument creating a pool of connections to that node. So, Whats = the best way of handling this in a (web) application ? Should I create = multiple pools to each of the nodes in the cluster or is there a better = best practice. >=20 > BTW > Is there an equivalent to Hector's getKnownPoolHosts for JDBC ? >=20 > Many Thanks >=20 > Andy C >=20 > The University of Dundee is a Scottish Registered Charity, No. = SC015096. --Apple-Mail=_54D16873-9832-4B61-97CA-952B7B1F6A56 Content-Transfer-Encoding: quoted-printable Content-Type: text/html; charset=windows-1252 If = you are feeling adventurous this has connection pooling, it will only = work with 1.2 though https://github.com/datast= ax/java-driver

I'm not aware of the current best = practice for connecting pooling with the older JDBC driver. I can see = some support for pooling in the trunk but it does not appear to be in = the (current) 1.1.2 = branch. 

Cheers

http://www.thelastpickle.com

On 10/12/2012, at 3:23 AM, Andy Cobley <acobley@computing.dundee.ac= .uk> wrote:

I'm starting to move to JBC for Cassandra (away from Hector). =    In his strange loop 2012 anti-pattern presentation, Mathew = Dennis writes:

"Sometimes people try to restrict clients to a = single node. This actually takes work, and causes problems. Don=92t do = it."

Now, I = note that the JDBC pooled connection class takes = a single  node as an argument creating  a pool = of connections to that node.   So, Whats the best way of = handling this in a (web) application ?  Should I = create multiple pools to each of the nodes in the cluster or = is there a better best practice.

BTW
Is there = an equivalent  to = Hector's getKnownPoolHosts for JDBC = ?

Many = Thanks

Andy = C

The University of Dundee is a Scottish Registered Charity, No. SC015096.

= --Apple-Mail=_54D16873-9832-4B61-97CA-952B7B1F6A56--