Hi,
I am getting the below error during tht execution of procedure in package.
Lock exception: ORA-20104: Document is already locked for this session. DocumentId = 9135476466313766885, SessionId = ORA-06512: at "MNIL_PROD.PKGRECONCILIATION", line 5720 ORA-06512: at line 1 SQL: begin pkgreconciliation.checkLockForDocument(:1 ,:2 ); end; ^-- error at this line -- ORA-20104: Document is already locked for this session. DocumentId = 9135476466313766885, SessionId = Binds: (9135476466313766885,null)
When i checked separately for this object then its showing no document lock.
Please let me know if anybody come across this type of issue and what will be possible solution.
Regards,
Rajiv
This is below the procedure :-
procedure checkLockForDocument(doc_id number, session_id varchar2)
is
v varchar2(500);
vs arrayofstrings;
modif_session_id varchar2(500);
begin
--1. Check if (document_id, session_id) record exists
if (isFeatureSupported(doc_id, PARALLEL_FEATURE) = 0) then
--parallel feature is not supported:
modif_session_id := null;
else
modif_session_id := session_id;
end if;
begin
select locked_object bulk collect into vs from nc_rec_locks
where object_id = doc_id
and (locked_object is null and modif_session_id is not null
or locked_object is not null and modif_session_id is null)
and lock_type = LOCK_TYPE_DOC_SESSION
for update nowait;
exception
when NO_DATA_FOUND then null;
when resource_busy then
raise_application_error(-20104, 'Document is already locked for this session. DocumentId = '||to_char(doc_id)||', SessionId = '||session_id);
end;