Object_cache is a native code obtained by AOT compilation.
Object_cache is created if it is absent. More specifically, it happens:
Object_cache is recreated:
Object_cache is saved here:
Object_cache includes (in particular) the application's metadata (<app_name>.exe.dll) and ID files (<app_name>.exe.id); object file; PIC, BC, RELOC, DAT files (depending on the type of the object_cache), etc.
Among other things, object_cache includes this information:
For example:
Current Build: 7.1.6672 00ec5b5 (rel)
Current Code Generator Version: 50
Compiled with Build: 7.1.6672 00ec5b5 (rel)
Compiled with Code Generator Version: 50
MSVC linker: C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\\bin\x86_amd64\link.exe
MSVC path: C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\\lib\amd64
To include object_cache information to the application (= qrun) logs, you must set these environment variables and their values to inet.env:
QXDEBUG=PzVzT
LYCIA_SEVERITY=TRACE
QX_TRACE=1
QX_TRACE_ARG_DUMP=1
When object_cache is built, qrun checks the code generator version used to the compile the program.
If the program was compiled with the same version of the code generator that is used when building object_cache, object_cache is created.
If versions of the code generator are different, object_cache is not created, and the application crashes with this error - 9260: Module was built with the different code generator version. The error is written to the to LyciaStudio / Lycia VS Code Extension console and/or LyciaConsole and/or application logs - depending on how you obtain the output of qrun stdout.
There are two types of object_cache generated by Lycia compiler - release cache and debug cache.
Release cache is the object_cache optimized for maximum runtime performance.
Debug cache (also called UNL cache) is the object_cache optimized for debugging purpose.
Differences between release and debug cache are these:
Debug info, e.g., includes internal instructions for Lycia debugger.
Line info is displayed to the error message at runtime:
|
|
debug cache (with line info) |
release cache (without line info) |
Depending on the cache used - release or debug, line info can be written to error logs (= logs initialized by startlog()):
Date: 11/21/2017 Time: 13:17:26
An exception (error) is being handled.
Module: new_program.exe [0000000a]
File: new_program.4gl
line 3 (1-12)
Function: main
The error code (9230) was received.
Invalid form: root container is missing
Form new_program is invalid. Root container is missing.
You can switch on the line info for release cache by setting the QX_REL_LINE_INFO environment variable:
QX_REL_LINE_INFO=1
If the cache wasn't built at deploy, it is built at the 1st run of the new application (or at the 1st run of the application after its deployed version was changed).
When you run applications from LyciaStudio, the debug cache is always used.
When you run applications via LyciaDesktop or LyciaWeb, release cache is used.
You can enable building debug cache in two ways:
by defining the QX_UNL environment variable with in inet.env and environ.bat:
QX_UNL=1
by adding the --unl flag to the qrun command:
qrun --unl
You can also set the QX_VERBOSE_CACHE environment variable in order to get verbose output for building the object_cache:
QX_VERBOSE_CACHE=1