11.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:
-
INSERT
an empty LOB,RETURNING
the LOB locator. -
Move data into the LOB using this locator.
-
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:
-
Create an empty (non-
NULL
) LOB -
Perform
INSERT
using the empty LOB -
SELECT-FOR-UPDATE
of the row just entered -
Move data into the LOB
-
COMMIT
. This releases theROW
locks and makes the LOB data persistent.
Parent topic: Performance Guidelines