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:
-
INSERTan empty LOB,RETURNINGthe 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
INSERTusing the empty LOB -
SELECT-FOR-UPDATEof the row just entered -
Move data into the LOB
-
COMMIT. This releases theROWlocks and makes the LOB data persistent.
Parent topic: Performance Guidelines