var sidebar_align = 'right';
var content_container_margin = parseInt('290px');
var sidebar_width = parseInt('270px');
Unanswered: to block table readers ( select )
How can we block table readers in oracle ?
The lock statement :
lock table tabname in exclusive mode
blocks only the writers ( insert, update and delete ) upto the unlock; but not the readers ( select ) .
But How we can block a select query's execution until unlock ?
ie. If one user inserting a row to tabname
and other user reading => select max(colname) from tabname.
Here, the reader may get the previous max value upto a commit.
Can I block this reading upto the commit execution ?
Sounds like you are trying to avoid sequences (deja vu all over again...)
No, you can't block readers. What you can do is build code using explicit locking on both sides:
- lock something (e.g. a row in a master table)
- lock same something as above
- select max(col) ...
There is also a package called DBMS_LOCK for performing bespoke locking.
excellent way to turn a $160,000 database into dbase III.