If a problem occurs, we will call the rollback method on the transaction object.
如果出现了任何问题,我们将调用事务对象中的rollback方法。
The linear rollback method is perhaps the simplest one based directly on air monitoring data.
线性压值法也许是直接根据监测资料所得到的最简单的方法。
It is therefore recommended to use transacted sessions and code explicit commit and rollback method calls when client mode is (or might be) used.
因此,当使用(或可能使用)客户机模式时,建议使用事务处理会话和代码显式commit和rollback方法调用。
In this case, you must invoke the commit method on the Connection object if all is well; otherwise, invoke the rollback method if an exception occurs.
在本例中,如果一切正常,您必须调用Connection对象上的commit方法;否则,如果出现异常,则调用rollback方法。
Once all the updates are performed you can invoke the commit method to commit the transaction, or the rollback method to roll back the transaction. Listing 5 illustrates this technique.
执行了所有更新之后,您可以调用commit方法来提交事务,或者调用rollback方法来回滚事务。
Regardless of where the method that starts the transaction resides, it's important that the transaction owner be the only method to manage the transaction and perform the commit or rollback.
无论开始事务的方法身处何处,事务所有者都是管理事务和执行提交或回滚的惟一方法,这一点非常重要。
Remember the golden rules: the client method invoking the API layer method is the transaction owner, and only the transaction owner should be responsible for rollback.
记住刚才的两条黄金法则:调用api层方法的客户机方法是事务所有者,只有事务所有者才负责执行回滚。
If the login is unsuccessful, it should rollback operations performed in its login method (the first phase), resetting state, and discarding any credentials acquired for the login principal.
如果登录不成功,就要回滚在它的登录方法(第一阶段)执行的操作,并复位状态、废弃登录主体所获取的所有凭证。
The second cause of USN rollback occurs when a domain controller has been restored using an unsupported method, most frequently using a disk cloning or imaging tool.
导致发生usn回滚的第二个原因是使用不受支持的方法(最常使用的是磁盘克隆或映像工具)还原了域控制器。
Unfortunately, the effect of this characteristic is that a lower-level method that isn't the transaction owner might perform a rollback on exception.
遗憾的是,此特性的效果是,作为非事务拥有者的较低级方法可以对异常执行回滚。
Notice that the domain-model method does not contain rollback logic.
注意,域模型方法并没有包含回滚逻辑。
Typically most developers specify Exception.class as the value, indicating that all exceptions in this method should force a rollback.
通常大多数开发人员指定Exception . class作为值,表示该方法中的所有异常应该强制回滚。
Listing 3. test1 method, forced exception demonstrating rollback.
清单3 .test1方法,强制异常演示回滚。
However, if one public update method invokes another, the transaction owner may not have control of the rollback logic in some circumstances.
然而,如果其中一个公共更新方法调用了另一个,那么事务所有者在某些情况下可能无法控制回滚逻辑。
First, if a method did not start a transaction, it has no business managing that transaction (for example, marking it for rollback).
首先,如果某个方法没有启动事务,那么它就不需要管理事务(例如,将其标记为回滚)。
First, if a method did not start a transaction, it has no business managing that transaction (for example, marking it for rollback).
首先,如果某个方法没有启动事务,那么它就不需要管理事务(例如,将其标记为回滚)。
应用推荐