Databases Reference
In-Depth Information
Without Latching
This part of the example represents a world without latches. Assume that the row containing the
values (2,200) in Transaction 1 arrived at the page a fraction of a second before Transaction 2, when
the values (3,300) are written. Transaction 1 writes to Slot 1, as seen in Figure 7-9 and Figure 7-10.
Slot 1, Offset 0x6f, Length 15, DumpStyle BYTE
Record Type = PRIMARY_RECORD
Record Attributes = NULL_BITMAP
Record Size = 15
Memory Dump @0x000000001580A06F
0000000000000000:
10000c00 02000000 c8000000 020000
........È......
FIGURE 7-9
HEADER INFORMATION
m_slotCnt=1
m_freedata=111
HEADER
INFORMATION
(1,100)
(2,200)
FIGURE 7-10
The update has gone through, as you have a second row in the page in slot 1 with the hex values 02
and c8 (which are the values 2 and 200 , respectively). However, the page header is not yet updated.
They still appear as in Figure 7-7. m_freedata is still 111 , and the m_slotcnt value is still 1 .
Before the header information is written, Transaction 2 arrives and wants to write a row with its
values (3,300). Without a mechanism to stop it, Transaction 2 queries the m_freedata and m_
slotcnt values, and writes its data into Slot 1, as seen in Figure 7-11 and Figure 7-12.
Slot 1, Offset 0x6f, Length 15, DumpStyle BYTE
Record Type = PRIMARY_RECORD
Record Attributes = NULL_BITMAP
Record Size = 15
Memory Dump @0x0000000011FEA06F
0000000000000000:
10000c00 03000000 2c010000 020000
........,......
FIGURE 7-11
Search WWH ::




Custom Search