10.2 Moving Data to LOBs in a Threaded Environment

Learn about the recommended procedure to follow while moving data to LOBs in this section.

There are two possible procedures that you can use to move data to LOBs in a threaded environment, one of which should be avoided.

Recommended Procedure

The recommended procedure is as follows:

  1. INSERT an empty LOB, RETURNING the LOB locator.

  2. Move data into the LOB using this locator.

  3. COMMIT. This releases the ROW locks and makes the LOB data persistent.

Alternatively, you can use Data Interface to insert character data or raw data directly for the LOB columns or LOB attributes.

Procedure to Avoid

The following sequence requires a new connection when using a threaded environment, adversely affects performance, and is not recommended:

  1. Create an empty (non-NULL) LOB

  2. Perform INSERT using the empty LOB

  3. SELECT-FOR-UPDATE of the row just entered

  4. Move data into the LOB

  5. COMMIT. This releases the ROW locks and makes the LOB data persistent.