I'm developing a multi-threaded application in which each thread accesses Cassandra in Java. Shall I create multiple clusters and close them after each access or multiple sessions? Can I create the cluster or the session as static data members?
Here is the log I got when declaring both as static:
14:40:50.361 [cluster1-nio-worker-0] DEBUG com.datastax.driver.core.Connection - Connection[localhost/127.0.0.1:9042-1, inFlight=0, closed=false] was inactive for 30 seconds, sending heartbeat
14:40:50.361 [cluster1-nio-worker-0] DEBUG com.datastax.driver.core.Connection - Connection[localhost/127.0.0.1:9042-1, inFlight=0, closed=false] heartbeat query succeeded