incubator-cassandra-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Green, John M (HP Education)" <john.gr...@hp.com>
Subject Driver documentation questions
Date Fri, 07 Mar 2014 20:42:34 GMT
I've been tinkering with both the C++ and Java drivers but in neither case have I got a good
indication of how threading and resource mgmt should be implemented in a long-lived multi-threaded
application server process.    That is, what should be the scope of a builder, a cluster,
session, and statement.   A JDBC connection is typically a per-thread affair.    When application
server receives a request, it typically

a)      gets JDBC connection from a connection pool,

b)      processes the request

c)       returns the connection to the JDBC connection pool.

All the Cassandra driver sample code I've seen so far is for single threaded command-line
applications so I'm wondering what is thread safe (if anything) and what objects are "expensive"
to instantiate.   I'm assuming a Session is analogous to a JDBC connection so when a request
comes into my multi-threaded application server, I should create a new Session (or find a
way to pool Sessions), but should I be creating a new cluster first?   What about a builder?

John "lost in the abyss"

Mime
View raw message