9-3-4 Transaction processing
Reference
Online transaction
processing
“Online transaction processing” is a
process in which a client connected to a
network sends a processing request to
a server, and the server performs the
task accordingly and returns the results
to the client. Usually, there are many
processes involved with updating the
database (including adding and deleting
data), and if processing is interrupted,
inconsistency in the data will result. For
this reason, reliability is required.
When manipulating a database, it is necessary to maintain database consistency using exclusive control, recovery functionality, etc. to handle referencing and updates to the data by multiple users.
1
Exclusive control
“Exclusive control” is a function that temporarily prevents data writing
on the part of one user, when two are simultaneously attempting to update
the same data in order to prevent inconsistencies from arising within the
database. To restrict access, the database is “locked.” The consistency of
the data can be maintained by restricting access.
(1)Lock
By “locking” the database, users can be prevented from using data that is
being updated or referenced by another user. There is an “exclusive lock,”
where both updating and referencing are locked, and a “shared lock (read
lock),” where only updating is locked.
In general, when performing an update process (insert, update, or delete),
the database management system automatically applies an exclusive lock.
When performing a reference process, the program can specify whether to
apply a shared lock.
[External data usage and lock status]
Update
Reference
Delete
Exclusive lock by other program
Shared lock by other program
255
Exclusive lock
Shared lock
×
×
×
×
×
×
○
×
×
○