What happens to the prepared statements of an application when cassandra is restarted?

百般思念 提交于 2019-12-12 16:17:34

问题


Let's take a java ee application in production, which uses prepared statements. Let's assume that it prepared required statements on initialization of its session beans.

In cassandra, each prepared statement has an id. If now, if cassandra is restarted, will java ee application also needs to get restarted?


回答1:


Almost all Cassandra clients should support this situation without having to restart (all datastax drivers do to my knowledge). For example, in the java-driver, when a node goes down and comes up again, one of the first things it does when marking it as available is reprepare all PreparedStatements your application has registered.

In addition, if you make a query using a PreparedStatement in your application and a Cassandra node responds that it does not know about that statement, the client should prepare that query and retry the request.



来源:https://stackoverflow.com/questions/29844182/what-happens-to-the-prepared-statements-of-an-application-when-cassandra-is-rest

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!