如果其中一个失败,我需要回滚查询
我已尝试过此功能,但它不带参数
added = models.DateTimeField(auto_now_add=True, null=True, blank=True,)
last_updated = models.DateTimeField(auto_now=True, null=True, blank=True,)
这是我需要 val trans = (
for {
insertPerson <- PersonDal.insert
deletePerson <- PersonDal.delete
} yield ()).transactionally
def futureTest = db.run(trans)
参数
case class
如何在提交和回滚的查询中使用 def updateEntryInsuranceRate(insurancerate: EntryInsuranceRate): Future[Int] = {
db.run(DalEntryInsuranceRate.updateEntryInsuranceRate(insurancerate))
}
def deleteEntryInsuranceRate(insurancerate: EntryInsuranceRate): Future[Int] = {
db.run(DalEntryInsuranceRate.deleteEntryInsuranceRate(insurancerate))
}
或其他transactionally
?