我正在使用ScalarDB在Cassandra应用程序中添加ACID支持。如果我启动了一个Transaction,但没有提交它,会发生什么情况?它会有任何不利的影响吗?
例如:
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
}
}发布于 2020-08-11 19:56:07
更准确地说,如果您将SERIALIZABLE用于只读事务并使用读取数据,则可能会导致异常(读偏差异常或只读事务异常)。
因此,作为最佳实践,调用commit总是更好。
发布于 2020-08-03 11:20:50
没有任何效果。事务中的所有变化都存储在客户端的内存中,直到提交。其他事务看不到它们,数据存储(Cassandra)没有收到任何突变请求。
https://stackoverflow.com/questions/63179623
复制相似问题