You are reading the code right, I am setting the keyspace each time you execute an action against cassandra. I have tried some time ago to separate connection pools for each keyspace, in order to select a connection based on the keyspace you need to work
on. That would be the best approach from my point of view, but I can see I almost revert all the changes since I got lost on the changes.
Your recommendation seems a better solution that setting the keyspace always, since that "set" action actually goes against the cluster. That's seems annoying isn't it?
I will see if there might be an actual ISSUE created over Cassandra for this matter, or I will try to contact them to gather more information.
What seems pretty straigt is sending the keyspace within the whole command, and do the whole matter together.
Thanks for your interested. I will keep you updated.