S sunnyfairy Unregistered / Unconfirmed GUEST, unregistred user! 2008-11-22 #1 开启事物时ADOConnection.BeginTrans是应该写在try前面还是后面?<br>一直搞不清楚这个问题.应该有区别吧.
K kkyy Unregistered / Unconfirmed GUEST, unregistred user! 2008-11-23 #4 中间的语句执行是否成功,跟try没多大关系,可能语句没执行成功,但except不会触发,当然,如果网络可能突然中断,那么BeginTrans可能也会出错,考虑到这一层,你就把它写在try后面吧,否则的话,你原意可能是想放在前面,也没多大关系[]
中间的语句执行是否成功,跟try没多大关系,可能语句没执行成功,但except不会触发,当然,如果网络可能突然中断,那么BeginTrans可能也会出错,考虑到这一层,你就把它写在try后面吧,否则的话,你原意可能是想放在前面,也没多大关系[]
J jrq Unregistered / Unconfirmed GUEST, unregistred user! 2008-11-23 #5 习惯上-- []<br>基本的数据异常回滚块:<br> ADOConnection.BeginTrans;<br> try<br> ...<br> ADOConnection.CommitTrans;<br> except<br> ADOConnection.RollbackTrans;<br> end;<br><br>应用异常保护块:<br> try<br> ADOConnection.BeginTrans;<br> try<br> ...<br> ADOConnection.CommitTrans;<br> except<br> ADOConnection.RollbackTrans;<br> end;<br> except<br> ...<br> finally<br> ...<br> end;
习惯上-- []<br>基本的数据异常回滚块:<br> ADOConnection.BeginTrans;<br> try<br> ...<br> ADOConnection.CommitTrans;<br> except<br> ADOConnection.RollbackTrans;<br> end;<br><br>应用异常保护块:<br> try<br> ADOConnection.BeginTrans;<br> try<br> ...<br> ADOConnection.CommitTrans;<br> except<br> ADOConnection.RollbackTrans;<br> end;<br> except<br> ...<br> finally<br> ...<br> end;
E erzhong008 Unregistered / Unconfirmed GUEST, unregistred user! 2008-12-12 #6 个人习惯:<br> try<br> ADOConnection.BeginTrans;<br> ...<br> ADOConnection.CommitTrans;<br> except<br> ADOConnection.RollbackTrans;<br> end;
个人习惯:<br> try<br> ADOConnection.BeginTrans;<br> ...<br> ADOConnection.CommitTrans;<br> except<br> ADOConnection.RollbackTrans;<br> end;