Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
在 Cassandra 中插入/更新时,或者说应用程序中的表定义与 C* 服务器中的表定义不匹配时,phantom 如何处理这些类型的错误?
我看到一个已应用的结果集等,但没有关于异常或错误的信息。
如果错误是灾难性的并且操作无法执行,您将返回失败的未来。一个这样的例子是scala.concurrent.Future包装一个InvalidQueryException例子。
scala.concurrent.Future
InvalidQueryException
现在,失败的含义有很多种。如果您插入在 Cassandra 中有效的部分数据,列会自动设置为null即使业务明智,这在您的应用程序中也没有意义。
null
如果您使用 schema 自动生成 via 方法,表定义应该始终与数据库中的表定义匹配Database.create,因此 phantom 已经为您提供了一种自动执行此操作的机制。
Database.create