Big Field's Lazy-load

In DObject O/R Mapping persistence layer, big field, such as Blob, Clob, Text, Image etc., can be set as lazy-load. Thus when you are querying, these big field will be loaded at the first time they are used instead of loaded to memory immediately in order to improve the system's performance, as follows:

var

  employee : IEmployee;

  photo : string;

begin

  // Employee.Photo is set as LazyLoad

  employee := TEmployee.GetByEmployeeID(ObjectManager, 1);

  // ...

  // employee.Photo has not been loaded

  // ...

  photo := employee.Photo; // employee.Photo is loaded now

end;

Related Topics

Lazy-load and Caching