Optimization, Tblob lazy/eager load in runtime

Hi Wagner
Usually my Blob fields (Photos) are defined as Lazy Load, but in some cases, to avoid double SQL:
Result := Manager.Find(Id);//First sql
if Result <> nil then
ForceLoadPhoto(Result.Photo);//second sql to load blob

Is there away to do someting like:
FExplorer.GetAssociationByPropertyName(aClass, aPropName).Lazy := False;
for Blob Fields?


Yes, you can do it this way:

  Explorer.GetColumnByPropertyName(aClass, aPropName).IsLazy := False;

But be aware that it's not thread-safe.

That's it,

1 Like

This topic was automatically closed 60 minutes after the last reply. New replies are no longer allowed.