Oracle是否自动回滚放弃的会话? [英] Have Oracle automatically roll back abandoned sessions?
问题描述
$ b
有没有办法让Oracle在X时间后自动回滚空闲会话?或者当我以某种方式检测到连接丢失时回滚?
从我所做的实验中,如果我在提交之前终止了一个应用程序进程,行锁定将停留直到我登录到数据库并手动终止会话。
谢谢。
sqlnet.ora
中设置 SQLNET.EXPIRE_TIME
。 SQLNET.EXPIRE_TIME = 10
从文档: p>
目的
指定以分钟为单位的时间间隔客户端/服务器连接处于活动状态。
Is there any way to guarantee that an application won't fail to release row locks in Oracle? If I make sure to put commit statements in finally blocks, that handles the case of unexpected errors, but what if the app process just suddenly dies before it commits (or someone kicks the power cord / lan cable out).
Is there a way to have Oracle automatically roll back idle sessions after X amount of time? Or roll back when I somehow detects that the connection was lost?
From the experiments I've done, if I terminate an app process before it commits, the rows locks stay forever until I log into the database and manually kill the session.
Thanks.
Try setting SQLNET.EXPIRE_TIME
in your sqlnet.ora
.
SQLNET.EXPIRE_TIME=10
From the documentation:
Purpose
To specify a time interval, in minutes, to send a check to verify that client/server connections are active.
这篇关于Oracle是否自动回滚放弃的会话?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!