DATACASS-489 - Polish.

This commit is contained in:
John Blum
2017-09-13 08:39:41 -07:00
parent 4115cd3ca2
commit 41457a40d1

View File

@@ -814,12 +814,12 @@ include::exception-translation.adoc[]
== Controlling Cassandra connections
Applications connect to Apache Cassandra using `Cluster` and `Session` objects. A Cassandra `Session` keeps track of
multiple connections to the individual nodes and is designed as thread-safe and long-lived object.
multiple connections to the individual nodes and is designed to be a Thread-safe, long-lived object.
Usually, it's sufficient to use a single `Session` for the whole application.
Spring obtains a Cassandra `Session` through a `SessionFactory`. `SessionFactory` is part of
Spring acquires a Cassandra `Session` through a `SessionFactory`. `SessionFactory` is part of
Spring Data for Apache Cassandra and is a generalized connection factory.
It allows a container or a framework to hide connection handling and routing issues from the application code.
It allows the container or framework to hide connection handling and routing issues from the application code.
Here is an example of how to configure a default `SessionFactory` in Java code:
@@ -828,14 +828,16 @@ Here is an example of how to configure a default `SessionFactory` in Java code:
Session session = … // get hold of a Cassandra Session
CqlTemplate template = new CqlTemplate();
template.setSessionFactory(new DefaultSessionFactory(session));
----
`CqlTemplate` and other Template API implementations obtain a `Session` for each operation. Sessions are not closed
after invoking the desired operation due to their long-lived nature. Resource disposal responsibility lies in the using
container or framework.
`CqlTemplate` and other Template API implementations obtain a `Session` for each operation. Due to their
long-lived nature, Sessions are not closed after invoking the desired operation. Responsibility for proper
resource disposal lies with the container or framework using the Session.
You can find various `SessionFactory` implementations within the package `org.springframework.data.cassandra.core.cql.session`.
You can find various `SessionFactory` implementations within the `org.springframework.data.cassandra.core.cql.session`
package.
[[cassandra.template]]
== Introduction to `CassandraTemplate`