An application program defines the start and end of a global transaction, accesses resources within transaction boundaries, and usually decides whether to commit or roll back each transaction.
应用程序对全局事务的开始和结束进行了定义,在事务界限内获取资源,并且通常决定是否提交或回滚每个事务。
If the code performing the actions decides not to commit or cannot commit successfully, then it must roll back the transaction to undo the actions.
如果代码执行的操作决定不进行提交或者不能成功提交,那么它必须回滚该事务以取消这些操作。
For demonstration purposes, the transfer operation is modified to roll back the transaction whenever the transfer amount is an even number.
出于演示的目的,我们将转帐操作修改为每当转帐金额是偶数时就回滚事务。
应用推荐