Caching Oracle Database LOB Data
You can cache Oracle Database large object (LOB) data in cache groups in TimesTen.
TimesTen caches the data as follows:
-
Oracle Database
CLOB
data is cached as TimesTenVARCHAR2
data. -
Oracle Database
BLOB
data is cached as TimesTenVARBINARY
data. -
Oracle Database
NCLOB
data is cached as TimesTenNVARCHAR2
data.
The following example shows how to cache Oracle Database LOB data
Restrictions on Caching Oracle Database LOB Data
There are restrictions when caching Oracle Database LOB data into TimesTen.
These restrictions apply to caching Oracle Database LOB data in TimesTen cache groups:
-
Column size is enforced when a cache group is created.
VARBINARY
,VARCHAR2
andNVARCHAR2
data types have a size limit of 4 megabytes. Values that exceed the user-defined column size are truncated at run time without notification. -
Empty values in fields with
CLOB
andBLOB
data types are initialized but not populated with data. EmptyCLOB
andBLOB
fields are treated as follows:-
Empty
LOB
fields in the Oracle database are returned asNULL
values. -
Empty
VARCHAR2
andVARBINARY
fields in TimesTen are propagated asNULL
values.
-
In addition, cache groups that are configured for autorefresh operations have these restrictions on caching LOB data:
-
When LOB data is updated in the Oracle database by OCI functions or the
DBMS_LOB
PL/SQL package, the data is not automatically refreshed in the cache group in TimesTen. This occurs because TimesTen caching operations depend on Oracle Database triggers, and Oracle Database triggers are not processed when these types of updates occur. TimesTen does not notify the user that updates have occurred without being refreshed in TimesTen. When the LOB data is updated in the Oracle database through a SQL statement, a trigger is fired and autorefresh brings in the change. -
Since autorefresh operations always refresh entire rows, LOB data in the cache is updated when any other column in the same row is updated.