Database Reference
In-Depth Information
3.
Execute any DDL command, table (object level), and control
level (ALTER DATABASE).
4.
Exit SQL*Plus.
5.
Lose your database connection because of system failure.
6.
Execute any DML command in an SQL*Plus session where the
environment has been changed to commit automatically. The
SET AUTOCOMMIT ON command causes this behavior. The
default is set to OFF.
.
While you are making changes to a table, another user, in a separate session,
might query the same table. Your changes do not appear in the query results
of the other user. The other user sees the table as it was before you started
your transaction. Read consistency is provided by a combination of table
data and undo records. Read consistency helps concurrent users share the
database. The term
An interesting feature of transaction control is called
read consistency
concurrent users
implies concurrency, things happening
at the same time.
15.2.1
Locks
Older databases would sometimes lock out any queries on a table while you
made changes to it. The lock was then released when your transaction
ended. With the advent of read consistency, other users are allowed to query
the table you are changing, and they will not even know you are working on
that table. If two users try to update the same row or rows of a table, Oracle
Database 10
makes the second user wait until the first user completes his
or her work. This greatly reduces the chances of two users interfering with
each other's work. Two users can update the same table, so long as they are
not updating the same rows at the same time.
When you update a row in a table, your transaction obtains a
g
row-level
lock
. This lock prevents others from updating the row you have updated
until you end the transaction.
Another type of lock, called a
, reserves the entire table
for your changes so no other user can make changes to any row in the
table. Table-level locks have several degrees of exclusivity, ranging from
very strict (exclusive lock) to very unrestricted (row-share lock). Usually,
allowing Oracle Database 10
table-level lock
to handle locking works the best. However,
in special cases, you can use the LOCK TABLE command to impose a spe-
cific lock mode on a table. The syntax for the LOCK TABLE command is
g
Search WWH ::




Custom Search