Looking at the code seems like that every time I prepare a statement, the driver connects to Cassandra. So there is a blocking network round-trip each time I prepare a statement. Am I correct?
This brings me to the main point. I'm building a fully async/non-blocking app, and since there is no prepareAsync method, it's pretty much pointless to use prepared statements since they always just wait for the prepared statement to come back (see Uninterruptibles.getUninterruptibly(future) in Session.toPreparedStatement).
As a workaround I was thinking of preparing all the statements once at boot time, but I remember seeing on the mailing list that the prepared statements are stored on the server side in an LRU map and also don't survive server restarts. So not sure if it would be possible to cache the prepared statements.
So it seems like I'm stuck with using regular statements.
Is my thinking correct here or am I missing something?
BTW, If I can't use prepared statements, what's the best way to bind variables to a statement to prevent CQL injection?
Thanks,
Drew