scala提交和回滚事务

时间:2016-04-13 03:49:40

标签: scala playframework

如果其中一个失败,我需要回滚查询

我已尝试过此功能,但它不带参数

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

0 个答案:

没有答案