0

我正在使用 ScalarDB 在Cassandra应用程序中添加 ACID 支持。如果我开始 aTransaction但不提交会发生什么。会不会有什么不良影响?

例如。

def somefunction=  {
    //Create the transaction
    val transaction: DistributedTransaction = transactionService.start
    if(all OK){
... //go ahead with DB operations
     commitTransaction(transaction) //OK
      (user: User, profileAndPortfolio: ExternalUserProfile, emailToken: UserToken)
    } else {
//miss commiting the transaction here
    }
  }
4

2 回答 2

0

更正确地说,如果您将 SERIALIZABLE 与只读事务一起使用并使用读取数据,则可能会导致异常(读取倾斜异常或只读事务异常)。

因此,作为最佳实践,调用 commit 总是更好。

于 2020-08-11T11:56:06.527 回答
0

没有效果。事务中的所有突变都存储在客户端的内存中,直到提交。其他事务看不到它们,并且数据存储区 (Cassandra) 没有收到任何突变请求。

于 2020-08-03T03:20:50.393 回答