When using transactions, you are able to decide when changes to objects are saved to the drawing database. You use the Commit method to save the changes made to the objects opened within a transaction. If your program encounters an error you can rollback any changes made within a transaction with the Abort method.
在使用事务处理的时候,用户能够决定什么时候将修改过的对象保存到图形数据库中。在一个事务内使用 Commit 方法保存一个对象已完成的修改。如果你的程序遇到了一个错误,就可以使用 Abort 方法回滚一个事务内所有的修改。
If Commit is not called before Dispose is called, all changes made within the transaction are rolled back. Whether Commit or Abort are called, you need to call Dispose to signal the end of the transaction. If the transaction object is started with the Using statement, you do not have to call Dispose.
如果在没有调用 Commit 之前调用了 Dispose 方法,事务内所有的修改都会被回滚。无论 Commit 或 Abort 是否被调用,都必须调用 Dispose 以标示事务的结束。如果 transaction 对象是以 Using 语句开始,就不必调用 Dispose。