CAD开发者社区

 找回密码
 立即注册

QQ登录

只需一步,快速开始

ObjectARX 开发指南

提交和回滚更改 (.NET)

2023-1-1 15:18| 发布者: admin| 查看: 323| 评论: 0|来自: AutoCAD

使用事务时,可以决定何时将对对象的更改保存到图形数据库。您可以使用该方法保存对事务中打开的对象所做的更改。如果您的程序遇到错误,您可以使用该方法回滚事务中所做的任何更改。CommitAbort

之前未调用的 ifis 被调用,事务中所做的所有更改都将回滚。无论调用了什么,都需要调用来表示交易结束。如果事务对象以语句启动,则不必调用。CommitDisposeCommitAbortDisposeUsingDispose

VB.NET

'' Commit the changes made within the transaction
<transaction>.Commit()
 
'' Abort the transaction and rollback to the previous state
<transaction>.Abort()

C#

// Commit the changes made within the transaction
<transaction>.Commit();
 
// Abort the transaction and rollback to the previous state
<transaction>.Abort();

路过

雷人

握手

鲜花

鸡蛋

最新评论

QQ|Archiver|CAD开发者社区 ( 苏ICP备2022047690号-1 )

GMT+8, 2024-5-19 14:59

Powered by Discuz! X3.4

Copyright © 2001-2021, Tencent Cloud.

返回顶部