Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

locked by transaction: @console:Oracle (INTELLIJ CLIENT)

I am working on IntelliJ IDEA 14.1.4, Recently we connected database to the Client and it was working okay, until some recent times when we start getting error

[2015-09-28 10:12:55] locked by transaction: @console:Oracle - <<DBName>>@localhost

Now we can't perform any transaction as we keep getting the same error. We tried googling the error but could not find anything to solve the problem. Any help would be appreciated!!!

like image 715
JavaDragon Avatar asked Sep 28 '15 05:09

JavaDragon


2 Answers

I had this happen after a previous query I ran failed -- using PyCharm, not IntelliJ, but it is the same JetBrains system. I did not have Auto-commit turned on. Pycharm couldn't recover from the failed query for some reason, and it left an unresolved transaction active in the database. I disconnected from the database (hit the red stop button in the database window), and then I was able to resume with new queries with no problem. You might also try the rollback button at the top of the window with your SQL statements if reconnecting would cause you problems.

like image 79
cmaimone Avatar answered Oct 17 '22 06:10

cmaimone


Putting up answer for the same comment.

I think there should be some row lock on the DB. if you have an Oracle DBA, check out for table/row lock. It can happen if the transaction exception occurred and rollback didn't happen properly or a transaction is still open for a longer time.

You can execute the following query to check for the same if transaction is pending.

SELECT COUNT(*)
FROM v$transaction t, v$session s, v$mystat m
WHERE t.ses_addr = s.saddr
AND s.sid = m.sid;

Additional resources :

  • Oracle: How to find out if there is a transaction pending?
  • How to find locked rows in Oracle

Consult with your DBA after your initial research. I'm not aware about releasing locks.

like image 1
Karthik R Avatar answered Oct 17 '22 04:10

Karthik R