Improving Performance via Eager Link Fetching

The Infinity Process Engine uses an implementation of an object-relational mapping facility to provide Java object persistence based on SQL database systems. In default mode traversal of links between persisted objects usually requires one separate SQL call per traversal:

Assume object N with attributes n1, .., n4, and link n_m leading to an instance M, needs to be fetched. M itself contains attributes m1, .., m3. The SQL statement:

SELECT n1, .., n4, n_m FROM N ...

will be executed, followed by a separate SQL call:

SELECT m1, .., m3 FROM M WHERE m1=n_m.

Eager link fetching will result in one SQL call as follows:

SELECT n1, .., n4, n_m, m1, .., m3 FROM N [INNER|LEFT OUTER] JOIN M ON (N.n_m = M.m1).

The engine will instantiate N as before. Additionally M can be instantiated (if it is not already in cache), too, thus not requiring the previous second SQL call in case of the link between N and M gets traversed. As currently instances of M are only instantiated once during a transaction, any following request will get served from the in-memory cache.

By providing optional eager link fetching the number of SQL calls needed can be effectively reduced.

Eager Link Fetching is activated via the session property:

<session-name>.EagerLinkFetching = false/true.