I am using Cassandra prepared statements to execute my queries in a Scala application using the Datastax Cassandra Java driver.
We have conditional logic to check and see if a bound statement should execute based on some internal state of an object. Something to this effect:
def updateDatabase(x: String, y: String, z: String) = {
val bound = statement.bind(x,y,x)
if(sequence_nr < current){
session.execute(bound)
}
}
Does this introduce a memory leak in either our Scala application or in Cassandra? My inclination is to say no but didn't want to make that assumption as I don't fully understand what the driver is doing behind the scenes with the bind
call.
I appreciate the help.
bind
inside theif
. Why bind variables to a statement when you don't plan on using it? – Aaron