Reference counts for transient smart large objects

A transient smart large object is one that you created but have not stored its LO handle in the database.

Transient smart large objects can occur in the following ways:
  • You create a smart large object (with mi_lo_create(), mi_lo_copy(), mi_lo_expand(), or mi_lo_from_file()) but do not insert its LO handle into a column of the database.
  • You invoke a UDR that creates a smart large object in a query but never assigns its LO handle to a column of the database.
For example, the following query creates one smart large object for each row in the table1 table:
SELECT FILETOBLOB(...) FROM table1;
However, the preceding query does not store the LO handles for these smart large objects in any database column. Therefore, each of these smart large objects is transient.
Important: A smart large object is temporary in the sense that it will automatically be deleted at the end of the session (unless its LO handle is stored in the database). A transient smart large object is not a smart large object that is stored in a temporary sbspace.

You only increment the reference count to tell the database server that the LO handle for the smart large object is going to be stored in the database (and become a permanent smart large object). Therefore, the reference count of a transient smart large object is zero. The database server deletes the transient smart large object at the end of the session.

You can explicitly deallocate the LO handle for a transient smart large object with the mi_lo_release() function.

You can explicitly delete a transient smart large object with the mi_lo_delete_immediate() function.