Java - how to use cassandra session for multiple threads?
I am using cassandra as backend in web application(in java), where for each user need to create unique session or use single one as in below url?
I read session information in this link. https://docs.datastax.com/en/drivers/java/2.0/com/datastax/driver/core/Session.html
Its saying Session instances are thread-safe. Means one thread at a time can use this instance.
Also written that each session maintains multiple connections to the cluster nodes.
- if only one thread can use on session instance then what is use of creating multiple connection per session to the cluster nodes?
- Doesn't it slow downs multithread operations on session?
There are 1 suggested solutions here and each one has been listed below with a detailed description. The following topics have been covered briefly such as Session, Multithreading, Java, Cassandra. These have been categorized in sections for a clear and precise explanation.