Joe Celko's Data and Databases: Concepts in Practice
By Joe Celko
Chapter 20: Transactions and Concurrency Control
Chapter 20: Transactions and Concurrency Control
Overview
In the old days when we lived in caves and used mainframe computers with batch file systems, transaction processing was easy. You batched up the transactions to be made against the master file into a transaction file. The transaction file was sorted, edited, and ready to go when you ran it against the master file from a tape drive. The output of this process became the new master file, and the old master file and the transaction files were logged to magnetic tape in a huge closet in the basement of the company.
When disk drives, multiuser systems, and databases came along, things got complex?and SQL made it more so. But mercifully the user does not have to see the details. Well, here is the first layer of the details.
20.1 Sessions
The concept of a user session involves the user first connecting to the database. This is like dialing a phone number, but with a password, to get to the database. The SQL-92 syntax for this statement is
CONNECT TO
::= [ AS ] [ USER ] DEFAULT
but you will find many differences in vendor SQL products and perhaps operating system level logon procedures that have to be followed.
Once the connection is established, users have access to all the parts of the database to which they have been granted privileges. During this session, they can execute zero or more transactions. As...
Copyright Morgan Kauffmann Publishers 1999 under license agreement with Books24x7