outworkers / phantom

Schema safe, type-safe, reactive Scala driver for Cassandra/Datastax Enterprise

Home Page:http://outworkers.github.io/phantom/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

prepare statements fail if table was created after the application started running

opened this issue · comments

Throwing "unconfigured table" exception for prepared statements even though the table was created.
Steps to reproduce:
Prerequisites:
Make sure the table does not exist in cassandra

  1. Start your application with prepared statements
  2. Should see "unconfigured table" exceptions
  3. Create the table in Cassandra
  4. You will still see the "unconfigured table" exceptions
    Note: It happens only with Prepared Statements and Phantom-DSL version 2.22.0
    Not reproducible in Phantom-DSL version 2.16.4.

Hi @lakshmankhcl, could you please share some code?

We do test prepared statements extensively.

Non asynchronous prepared statements need to be lazydefined, otherwise they will trigger immediately, which is possibly the source of your problems.

Hi @lakshmankhcl I'm going to close this now, as I feel it's application specific rather than query specific.

In theory, you are executing those prepared statements ahead of time, and simply using lazy or whatever approach to make sure you don't trigger the prepared statements before the table is created is something that needs to be done on an application level, there's not much we can do from a framework perspective.

Even if we tracked all prepared statements globally within the framework, we wouldn't be able to do anymore than give you the same error Cassandra already does, and it would be also be a runtime error.