sql - WIll Select for update wait locks the rows permanently? -


i have 2 processes accessing same table. each of them runs select update query , wait value set.

my question is: if process 1 runs query , locks n rows in table, how can rows released if process 1 crashed before committing?

i tried open 2 sessions in sql developer , run select update in 1st session, close it. run same query in 2nd session, , found rows still locked!

the locks held transaction last long transaction lasts*. way release them end transaction.

what "crashed" mean precisely? in three-tier application, when front-end fails, middle tier cleans closing logical session closes associated transactions. in client-server application, if holder of lock doesn't shut down gracefully, oracle may not aware. dba configure dead-connection detection periodically send ping client verify still alive database can identify dead session exists after few minutes , roll back. if database isn't configured detect problem , client/server application doesn't close transaction, may have bit of wait. there may profile limits time session can connected or dba script kills sessions after period of time or might have call dba , ask them kill other session.

* pedantic, there user-defined locks can acquire via dbms_lock persist session rather transaction. that's outside scope of question.


Comments

Popular posts from this blog

javascript - Chart.js (Radar Chart) different scaleLineColor for each scaleLine -

apache - Error with PHP mail(): Multiple or malformed newlines found in additional_header -

java - Android – MapFragment overlay button shadow, just like MyLocation button -