存储过程和超时

发布于 2024-07-04 12:02:56 字数 91 浏览 5 评论 0原文

我正在运行一个长进程存储过程。

我想知道在启动对存储过程的调用后是否会出现超时或与数据库断开连接的情况。 它仍然在服务器上工作并实施更改吗?

I'm running a long process stored procedure.

I'm wondering if in case of a timeout or any case of disconnection with the database after initiating the call to the stored procedure. Is it still working and implementing the changes on the server?
­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(3

糖果控 2024-07-11 12:02:56

无论如何,如果客户端在作业结束时没有提交,则服务器应该回滚更改。

换句话说,如果您有一个存储过程对数据库进行更改,并且连接可能会在中间断开,请务必将所有更改包含在事务中。

Anyway if the client is not there to commit at the end of the job the changes should be rolled back by the server.

In other words, if you have a stored procedure making changes to the database and there is a possibility that the connection might disconnect in the middle, be sure to enclose all changes within a transaction.

小…红帽 2024-07-11 12:02:56

我猜这取决于服务器。
我知道 Firebird 会检测到断开连接的客户端并停止工作。
无论如何,如果客户端在作业结束时没有提交,则服务器应该回滚更改。

It depends on the server I guess.
I know Firebird will detect disconnected clients and stop working.
Anyway if the client is not there to commit at the end of the job the changes should be rolled back by the server.

悍妇囚夫 2024-07-11 12:02:56

我建议在数据库上运行探查器并观察活动,并创建一个基本测试用例,以便您确定会发生什么。 结果取决于您的数据库以及用于连接到该数据库的内容。

I would suggest running your profiler on the database and watching the activity, and also create a basic test case so that you know for sure what happens. The outcome is dependent on your database and what you are using to connect to it.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文