20.07.2013 Views

Beginning SQL

Beginning SQL

Beginning SQL

SHOW MORE
SHOW LESS

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

of record locks, the DBMS may decide that it is more efficient to simply lock pages of the database<br />

instead, or even the entire table. If a transaction locks records in dozens of tables, it may make sense to<br />

attempt to lock the entire database. In Figure 11-8, you see a situation where an extreme percentage of<br />

the records in a table are locked individually. In a situation like this, the DBMS may promote the many<br />

individual locks into a single lock on the entire table.<br />

Figure 11-8<br />

Escalation is simply an automatic process by the DBMS to attempt to consolidate many locks into a<br />

smaller number of locks. Even though it is an automatic process, the administrator may have some control<br />

over the process.<br />

Timeout<br />

Transaction<br />

Locks<br />

on<br />

Individual<br />

Records<br />

Transaction<br />

Locks<br />

Escalates to<br />

Entire Table<br />

Escalation<br />

Orders<br />

Orders<br />

Transactions<br />

As the number and complexity of transactions climb, the time required to obtain the locks necessary for<br />

any given transaction to proceed can mount, and any given transaction may have to wait a very long<br />

time to process. Most DBMSs have parameters that the administrator can set that cause a transaction to<br />

time out and return an error if the locks cannot be obtained in a reasonable time.<br />

317

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!