System Architecture 2-79
Writing Data to a Blobspace
Atthe time that the blob data is being transferred, the row itself may not yet
exist.During an insert, for example, the blob is transferred before the rest of
the row data. After the blob is stored, the data row is created with a 56-byte
descriptor that points to the location of the blob. (Refer to page 2-143 for
further information on blob storage and the blob descriptor that is stored in
the data row.)
Duringthe procedure for writing blob data to a blobspace, OnLine attempts
to performI/O based on the user-defined blobpage size. If, for example, the
blobpagesize is 32 KB, OnLine attempts to read or write blob data in 32,768-
byte increments. If the underlying hardware (such as the disk controller)
cannot transfer this amount of data in a single operation, theUNIX kernel
loopsinternally (in kernel mode) until the transfer is complete. The following
paragraphs describe this procedure as it occurs when a blob is inserted into
a blobspace.
To receive blob data from the application development tool, the OnLine
server process establishes an open blob for the specific table and row,
meaning that a blob is about to be created.
Aspart of establishing an open blob, a set of blobspace blob buffers is created.
The set is always composed of two buffers, each the size of one blobspace
blobpage.At any time, only one set of blobspace blob buffers can be used to
transfer blobspace blob data. That is, only one user process can transfer
blobspaceblob data to the disk at a time. Only the OnLine server process that
established the open blob can gain access to the buffers.
Blobdata is transferred from the application development tool to the OnLine
databaseserver in 1-KB chunks. The server process begins filling the buffers
with the 1-KB pieces and attempts to buffer two blobpages at a time. The
reasonfor the attempt to fill both buffers is to determine if this is the last page
to be written or if a forwarding pointer to the next page is needed. If both
buffersfill, the server process learns that it must add a forwarding pointer to
the data in the first blobpage buffer when it is stored.
Whenthe OnLine server process begins writing the first blobspace blobpage
buffer to disk, it attempts to perform theI/O based on the blobpage size, as
explained earlier.