Home | Previous Page | Next Page   Tuning and Troubleshooting > Managing Performance >

Managing Memory for Large Objects

Whenever a large object (a BYTE, TEXT, BLOB, or CLOB data type) is fetched from the database server, the data is either cached into memory or stored in a temporary file (if it exceeds the memory buffer). A JDBC applet can cause a security violation if it tries to create a temporary file on the local computer. In this case, the entire large object must be stored in memory.

You can specify how large object data is stored by using an environment variable, LOBCACHE, that you include in the connection property list, as follows:

If the LOBCACHE size is invalid or not defined, the default size is 4096.

You can set the LOBCACHE value through the database URL, as follows:

URL = jdbc:informix-sqli://158.58.9.37:7110/test:user=guest;
password=iamaguest;informixserver=oltapshm;
lobcache=4096";

The preceding example stores the large object in memory if the size is 4096 bytes or fewer. If the large object exceeds 4096 bytes, IBM Informix JDBC Driver tries to create a temporary file. If a security violation occurs, memory is allocated for the entire large object. If that fails, the driver throws an SQLException message.

Here is another example:

URL = "jdbc:informix-sqli://icarus:7110/testdb:
   user=guest:passwd=whoknows;informixserver=olserv01;lobcache=0";

The preceding example uses a temporary file for storing the fetched large object.

Here is a third example:

URL = "jdbc:informix-sqli://icarus:7110/testdb:user=guest:
   passwd=whoknows;informixserver=olserv01;lobcache=-1";

The preceding example always uses memory to store the fetched large object.

For programming information on how to use the TEXT and BYTE data types in a Java program, refer to BYTE and TEXT Data Types. For programming information on how to use the BLOB and CLOB data types in a Java program, refer to Smart Large Object Data Types.

Home | [ Top of Page | Previous Page | Next Page | Contents | Index ]