Table Lock during Insertion
I have a scenario, where a user can enter transaction deatils through application for a account#
and was inserted into the table 'Repo_assignments'
During the multi-user testing, when the user tried to enter transaction with multiple sessions of a same account#, it was able to insert and get duplicated
When the below code implemented before insertion into the repo_assignments , failed to validate the duplicate check
select count(1) from repo_assignments
where acct_no = v_acct_no
and status in (101,102,103,104,)
. .. . . .
. . . .
if v_cnt = 0 then
insert into repo_assignments values (... . . . . . . . . .);
end if;
even though, codes accepts to insert the details with same time, (differ in milli seconds)