PL/SQL (MOSC)

MOSC Banner

Table Lock during Insertion

edited Jan 30, 2012 4:47AM in PL/SQL (MOSC) 3 commentsAnswered ✓
Hi All

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)

Howdy, Stranger!

Log In

To view full details, sign in to My Oracle Support Community.

Register

Don't have a My Oracle Support Community account? Click here to get started.

Category Leaderboard

Top contributors this month

New to My Oracle Support Community? Visit our Welcome Center

MOSC Help Center