I am trying to resolve an issue where the application user is prompted ORA-00054 in Oracle AgilePLM. From sql logs I came to know that the following command is causing this issue.
SELECT 1 FROM CLUSTER_THREAD_LOCKS WHERE LOCK_TYPE = 3 FOR UPDATE OF LOCK_COUNT, LAST_LOCK_TIME NOWAIT
Status:FAILURE
Reason - ORA-00054: resource busy and acquire with NOWAIT specified or timeout expired
I cannot set auto commit on
as it is a session based setting and same goes to ddl_lock_timeout
, and I wanted it to be global. However, I am trying to a write a procedure and then schedule it in a DBMS_JOB, it will find the blocking session(s) on CLUSTER_THREAD_LOCKS
and commit that session(s). The problem I am facing is how to issue a commit to that session(s) on the basis of it sid and serial# in a stored procedure. Following is the procedure:
CREATE OR REPLACE PROCEDURE SP_COMMIT_SESSION()
AS
v_session_no int;
v_sid int;
BEGIN
for c in
(
select obj.object_id, ses.sid, ses.serial#,user_objects.object_name, to_char(ses.logon_time, 'MM-DD-YYYY HH24:MI:SS') lock_date
from v$session ses, V$LOCKED_OBJECT obj, user_objects where
ses.sid = obj.session_id and user_objects.object_id = obj.object_id
AND USER_OBJECTS.OBJECT_NAME = 'CLUSTER_THREAD_LOCKS'
)
loop
v_session_no := c.serial#;
v_sid := sid;
/*
Issue commit here
*/
end loop;
end;
I can neither kill a session as I do not know its' impacts, nor I can change how the SQL command is issued from the application. Could anyone point me to the right direction?