http://www.amicabile.com/hybernate/hybernate-
chapter5.html
http://javacompleteexamples.blogspot.com/2009/07/how-db-locking-system-works-
in.html
编辑:
尝试:
@Override@Loggable(value = LogLevel.TRACE)@Transactionalpublic void updateBalance(String id, BigDecimal amount) { Account acc = (Account) sessionFactory.getCurrentSession().get(Account.class, id, LockMode.UPGRADE); acc.setBalance(acc.getBalance().subtract(amount)); save(acc);}


