Connection Pooling with Cassandra and JBoss

319 views
Skip to first unread message

Bill K

unread,
Jan 29, 2016, 8:44:25 AM1/29/16
to DataStax Java Driver for Apache Cassandra User Mailing List
We're just getting started with Cassandra and JBoss.  I'm looking for a way to set up connection pooling to avoid having to do expensive connects and disconnects on every CQL request.

For example, we currently have connection pooling implemented with Oracle and JBoss.  In the standalone-full-ha.xml file, we specify the JDBC driver and define a datasource that references that driver.  The datasource contains the pool information.

Does something similar exist for Cassandra?  Thanks.

Bill

Gábor Auth

unread,
Jan 29, 2016, 8:59:59 AM1/29/16
to java-dri...@lists.datastax.com
Hi,

On Fri, Jan 29, 2016 at 2:44 PM Bill K <bk0...@gmail.com> wrote:
We're just getting started with Cassandra and JBoss.  I'm looking for a way to set up connection pooling to avoid having to do expensive connects and disconnects on every CQL request.

We are using Cassandra with Wildfly, here is an example (you can navigate with PgUp and PgDn): http://prezi.javaforum.hu/gacivs-devop/#/11/3

Bye,
Gábor Auth

Olivier Michallat

unread,
Jan 29, 2016, 10:00:06 AM1/29/16
to java-dri...@lists.datastax.com
Connection pooling is built into the driver. You should create a single Session object, keep it open and share it across your application (for example as a field in a singleton, as in Gábor's example). It will take care of maintaining connections to the Cassandra cluster.


--

Olivier Michallat

Driver & tools engineer, DataStax


--
You received this message because you are subscribed to the Google Groups "DataStax Java Driver for Apache Cassandra User Mailing List" group.
To unsubscribe from this group and stop receiving emails from it, send an email to java-driver-us...@lists.datastax.com.

Reply all
Reply to author
Forward
0 new messages