H.K
H.K

Reputation: 133

Does Cassandra session re-create when WAS disconnects to Cassandra cluster?(e.g. Network issue)

I have tested with Circle CI and docker(cassandra img) and When I test, logs appear like below

"Tried to execute unknown prepared query. You may have used a PreparedStatement that was created with another Cluster instance."

But Cassandra Cluster exists as solo. So, I can't understand What makes this error.

Could it happen because of Cassandra Connection issue? Tests have failed sometimes because WAS can't connect to Cassandra Cluster (I think CircleCI causes this issue) so I just guess

  1. WAS can't connect to Cassandra Cluster during testing
  2. Session re-created
  3. Error logs with PreparedStatement happens

Is it Possible? If not, How does this Error happen though just One Cassandra Cluster is operating?

Upvotes: 0

Views: 60

Answers (1)

Erick Ramirez
Erick Ramirez

Reputation: 16353

The "Cluster instance" being referred to in this message is the Cluster object in your app code:

Tried to execute unknown prepared query. You may have used a PreparedStatement \
  that was created with another Cluster instance.

That error implies that you have multiple Cluster objects in your app. You should only have one instance that is shared throughout your app code and you shouldn't create multiple Cluster objects. Cheers!

Upvotes: 1

Related Questions