gpt4 book ai didi

asp-classic - 如果 ASP 页意外退出,Connection 事务会发生什么情况?

转载 作者:行者123 更新时间:2023-12-04 04:34:33 25 4
gpt4 key购买 nike

在经典 ASP 中,如果页面遇到未捕获的异常并在提交/回滚之前停止,Connection 事务会发生什么情况?

例如:

conn.BeginTrans

a = 0 / 0

conn.CommitTrans

看到事务正在进行中,它会被中止还是提交?或者当它返回到连接池时连接会维护事务吗?

最佳答案

要返回连接池,连接,隐式或显式,应该被认为是关闭的。连接关闭时挂起的任何事务都将回滚。

但是当连接被认为是事件的时,数据库中获得的资源/锁仍将被维护。

编辑 - 从影子向导(谢谢)找到的与 ADO 连接对象相关的信息:here

Closing a Connection object while there are open Recordset objects on the connection rolls back any pending changes in all of the Recordset objects. Explicitly closing a Connection object (calling the Close method) while a transaction is in progress generates an error. If a Connection object falls out of scope while a transaction is in progress, ADO automatically rolls back the transaction

关于asp-classic - 如果 ASP 页意外退出,Connection 事务会发生什么情况?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/19974810/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com