Take the 2-minute tour ×
Database Administrators Stack Exchange is a question and answer site for database professionals who wish to improve their database skills and learn from others in the community. It's 100% free, no registration required.

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?

share|improve this question
    
Can you please give some more information? Is this an application you are developing? –  Martin Sjöberg 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
add comment

2 Answers

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

share|improve this answer
    
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
add comment

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.

share|improve this answer
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

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