grails-test

Grails Service Transactions

一个人想着一个人 提交于 2020-01-15 09:51:49
问题 I'm trying to get transactions working within a Grails service, but I'm not getting the results I'm expecting. Can someone tell me if I'm doing something wrong, if my assumptions are off? My domain class: class Account { static constraints = { balance(min: 0.00) } String companyName BigDecimal balance = 0.00 Boolean active = true String toString() { return "${companyName} : ${balance}" } } My service: class AccountService { static transactional = true def transfer(Account source, Account

Grails Service Transactions

回眸只為那壹抹淺笑 提交于 2020-01-15 09:51:31
问题 I'm trying to get transactions working within a Grails service, but I'm not getting the results I'm expecting. Can someone tell me if I'm doing something wrong, if my assumptions are off? My domain class: class Account { static constraints = { balance(min: 0.00) } String companyName BigDecimal balance = 0.00 Boolean active = true String toString() { return "${companyName} : ${balance}" } } My service: class AccountService { static transactional = true def transfer(Account source, Account