Oracle8i Application Developer's Guide - Large Objects (LOBs)
Release 2 (8.1.6)

Part Number A76940-01

Library

Product

Contents

Index

Go to previous page Go to beginning of chapter Go to next page

Advanced Topics, 3 of 6


LOB Locators and Transaction Boundaries

A basic description of LOB locators and their operations is given in Chapter 2, "Basic Components".

This section discusses the use of LOB locators in transactions, and transaction IDs.

Locators Contain Transaction IDs When...

Locators Do Not Contain Transaction IDs When...

Transaction IDs: Reading and Writing to a LOB Using Locators

You can always read the LOB data using the locator irrespective of whether the locator contains a transaction ID.

The following examples show the relationship between locators and non-serializable transactions

Non-Serializable Example: Selecting the Locator with No Current Transaction

Case 1:

    1. Select the locator with no current transaction. At this point, the locator does not contain a transaction id.

    2. Begin the transaction.

    3. Use the locator to read data from the LOB.

    4. Commit or rollback the transaction.

    5. Use the locator to read data from the LOB.

    6. Begin a transaction. The locator does not contain a transaction id.

    7. Use the locator to write data to the LOB. This operation is valid because the locator did not contain a transaction id prior to the write. After this call, the locator contains a transaction id.

Case 2:

    1. Select the locator with no current transaction. At this point, the locator does not contain a transaction id.

    2. Begin the transaction. The locator does not contain a transaction id.

    3. Use the locator to read data from the LOB. The locator does not contain a transaction id.

    4. Use the locator to write data to the LOB. This operation is valid because the locator did not contain a transaction id prior to the write. After this call, the locator contains a transaction id. You can continue to read from and/or write to the LOB.

    5. Commit or rollback the transaction. The locator continues to contain the transaction id.

    6. Use the locator to read data from the LOB. This is a valid operation.

    7. Begin a transaction. The locator already contains the previous transaction's id.

    8. Use the locator to write data to the LOB. This write operation will fail because the locator does not contain the transaction id that matches the current transaction.

Non-Serializable Example: Selecting the Locator within a Transaction

Case 3:

    1. Select the locator within a transaction. At this point, the locator contains the transaction id.

    2. Begin the transaction. The locator contains the previous transaction's id.

    3. Use the locator to read data from the LOB. This operation is valid even though the transaction id in the locator does not match the current transaction.

      See Also:

      "Read-Consistent Locators" for more information about using hte locator to read LOB data. 

    4. Use the locator to write data to the LOB. This operation fails because the transaction id in the locator does not match the current transaction.

Case 4:

    1. Begin a transaction.

    2. Select the locator. The locator contains the transaction id because it was selected within a transaction.

    3. Use the locator to read from and/or write to the LOB. These operations are valid.

    4. Commit or rollback the transaction. The locator continues to contain the transaction id.

    5. Use the locator to read data from the LOB. This operation is valid even though there's a transaction id in the locator and the transaction was previously committed or rolled back.

      See Also:

      "Read-Consistent Locators" for more information on the using the locator to read LOB data. 

    6. Use the locator to write data to the LOB. This operation fails because the transaction id in the locator is for a transaction that was previously committed or rolled back.

      
      

Go to previous page Go to beginning of chapter Go to next page
Oracle
Copyright © 1996-2000, Oracle Corporation.

All Rights Reserved.

Library

Product

Contents

Index