Collaboration diagram for Pinning Records:
You may pin (force to remain in the buffer pool at a fixed location) portions (no larger than a page) of a record for short periods of time while you operate on them. You may step through a large record pinning a sequence of such portions.
Use of the pin_i requires care. Take care to observe the following constraints:
- You may not operate on the in-buffer-pool copy directly, as the only storage manager knows the format of these data. You may operate on these pinned data through the class pin_i.
- Do not hold page latches (keep a page pinned) for long periods (while a thread sleeps, awaits I/O, or otherwise blocks long-term. Operating system scheduling of threads is not under your control for this purpose). Latches are meant to be short-term. Holding a latch for a long time interferes with other aspects of the storage manager, including buffer-pool cleaning.
- A latch is held by a thread, not by a transaction. Under no circumstances can a pin_i be passed from thread to thread.
- It is dangerous to operate on a record through the static storage manager methods (such as append_rec) while holding records pinned through pin_i. This can lead to invalid pin_i with undefined results when they are used; doing so with concurrent threads in a single transaction can lead to undetectable deadlocks (latch-latch deadlocks, for example).
| ||Pin records in the buffer pool and operate on them. More...|
Generated on Mon Jan 2 15:14:01 2012 for Shore Storage Manager by