I made a small modification to the eclipse project today and found that the previously running project is always stuck today. I started to think that the database has not closed the connection, leading to connection congestion, later, I took a closer look at every closed link. The next breakpoint debugging finds that a problem occurs during the update process and the program is stuck on the update process. I use plsql to query data in the database, which is also stuck, and another piece of data can be normally executed. Google finds the cause of the problem.
Oracle automatically locks the record when the program has executed executeupdate but has not committed the transaction commit.
The solution is as follows.
Query the sid and serial # Fields of the locked data.
- SELECT s. sid,
- S. serial #
- FROM v $ locked_object lo,
- Dba_objects ao,
- V $ session s
- WHERE ao. object_id = lo. object_id AND lo. session_id = s. sid;
Delete the record locked by the system.
ALTER system KILL session'Sid, serial #';
If there are multiple sid and serial #, delete each record repeatedly.