Summary: What to do when Entry arrays or collection attribute types are very large, so that the database cannot store them in a one-column cell.

Overview

When persisting a space with JDBC, there are situations where Entry arrays or collection attribute types are very large and the database in use cannot store such objects in a one-column cell. In such situations, the following recommendations might help:

  • Split the large collection into smaller collections. This can be done via a business logic that groups collection elements. For example, instead of one collection attribute with 2000 members, you can have 4 attributes with 500 elements.
  • Store collection attribute element references (UID) as part of the parent object, and have each collection element as a separate Entry in the space. This pattern splits large Entry objects into many Entries, which are mapped into many database table rows without having a serialized form of the collection content. This slows the performance when you read the whole object graph (the object and all its child objects) from the database.
  • Use large BLOBs (Binary Large OBjects) – these allow you to persist large Entry binary fields (smaller than 4G). BLOBs are defined as binary=BLOB in the type.properties configuration file. Using BLOBs with Oracle database is explained below.
New in GigaSpaces 5.2
Big BLOBs are supported in GigaSpaces version 5.2 and onwards

Using BLOBs with Oracle Database

To store large binary fields using BLOBs with Oracle 9i and earlier versions, add the following line to the jdbc.properties file:

lobHandlerClass=com.j_spaces.sadapter.GenericJDBC.OracleLobHandler
(default = com.j_spaces.sadapter.GenericJDBC.DefaultLobHandler)

Oracle LOB definitions can be customized in the jdbc.properties using the LOB clause while creating a table, for example:

CREATE TABLE ContainsLOB_tab (n NUMBER, c BLOB) LOB  (c) STORE AS SEGNAME
(TABLESPACE lobtbs1 CHUNK 4096PCTVERSION 5NOCACHE LOGGINGSTORAGE (MAXEXTENTS 5));

Each Entry class with large fields can be customized in the jdbc.properties in the following way:

entryClassName.lobClause = LOB  (c) STORE AS SEGNAME (
TABLESPACE lobtbs1 CHUNK 4096PCTVERSION 5NOCACHE LOGGINGSTORAGE (MAXEXTENTS 5));
GigaSpaces.com - Legal Notice - 3rd Party Licenses - Site Map - API Docs - Forum - Downloads - Blog - White Papers - Contact Tech Writing - Gen. by Atlassian Confluence