Oracle是否自动回滚放弃的会话? [英] Have Oracle automatically roll back abandoned sessions?

查看:311
本文介绍了Oracle是否自动回滚放弃的会话?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

有什么方法可以保证应用程序不会在Oracle中释放行锁?如果我确保在finally块中放置提交语句,可以处理出现意外错误的情况,但是如果应用程序进程在提交之前突然死亡(或者某人将电源线/ LAN电缆踢出),该怎么办?

b
$ 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屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆