More specifically, is it "best practice" to reuse PreparedStatements,
rather than creating a new one  via session.prepare() on each database
access? Is there any performance benefit to this? I've glanced at the java
driver code and it does appear that if I were doing something like:

public List fetchSomething() {
    return this.session.execute(
      new BoundStatement(this.session.prepare("some cql").bind("some
vars")))
}

that the call to prepare() would in fact make a trip to the cluster
to....do something. I'm just asking if you should create the PS and hold on
to it, and keep reusing it for each actual query call, or if it matters, if
you can just create a new one each time.

Thanks,
Mike

Reply via email to