I have some kind of bug leaving lock on table in application that is connecting to Progress OpenEdge Database. Because of the lock I'm not able to test what app is doing wrong there (since I can't test it more than once because of lock and lock seems to last for very long).

Is there a way to remove all locks from table?

  • Can you please give some more information? Is this an application you are developing? Dec 7 '11 at 9:09
  • @Martin It is a bug in application. However I don't really need to remove the lock in application, I'll be happy with any kind of trick that will do that outside of it... Be it some SQL or ABL or something else (and that's why I didn't asked it on some other stachexchange)... I just need removal of lock to be able to test app in effective way.
    – korda
    Dec 7 '11 at 9:22

You can use locking hints to select from tables that have locks on them.

select * from tblUser with (NOLOCK) ;

This is ok practice with adhoc sql.

Note Don't use in productioncode without reading and understanding documentation fully.

If you want to kill blocking processes: http://www.kodyaz.com/articles/identify-kill-blocking-sql-server-processes.aspx

  • What I need is removal of current locks... Application does some inserts and updates. Selects aren't issue at all. When something goes wrong (and currently it goes almost every time) locks are left on table or rows (even if code I'm working on should close all transactions and connections in case of failure). I'm afraid I need to test it multiple times before I will find cause of the problem and with locks left on table I simply can't...
    – korda
    Dec 7 '11 at 10:51
  • Process blocking db is dead but the lock remains for some time...
    – korda
    Dec 8 '11 at 12:28

The only way to "remove" locks from a OE db is for

  1. the transaction to go to completion (and all buffers are re-read NO-LOCK or go out of scope),
  2. the client to crash, or
  3. the db to go down.

There's no programmatic way to clear the locks generated by a client session.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.