Have Oracle automatically roll back abandoned sessions?

后端 未结 3 1080
旧巷少年郎
旧巷少年郎 2021-01-24 17:57

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

相关标签:
3条回答
  • 2021-01-24 18:36

    COMMIT inside finally is probably the last thing you should do since you should (almost) never commit anything that threw an exception.

    0 讨论(0)
  • 2021-01-24 18:48

    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.

    0 讨论(0)
  • 2021-01-24 18:49

    I am not a DBA so I am sure you can find a better solution...

    but there are certain deadlock conditions that seem to happen that will not roll back on our own. My last DBA had a process that would run every minute and kill anything that had been running more than 10 minutes.

    0 讨论(0)
提交回复
热议问题