Documentation Comments
Use this form to comment on this topic. You can also provide any general observations about the Online Documentation, or request that additional information be added in a future release.
Reality V15.2 Online Documentation (MoTW) Revision 3
Optimisation (dbo_optimisation.htm)
Every use of the -> operator, either explicitly or implicitly (when using the default connection) requires a message to be sent to the Java language server, and a reply waited for.
Some code sequences do not require a result from the language server, and these code sequences can be optimised by disabling the wait for the reply.
This can be done by using %Set(NoEarlyErrorNotify) on the connection object. This has the effect that only statements that consume the result of an object operation will wait for a result.
It is quite safe to set NoEarlyErrorNotify immediately after a connection to run the complete program in optimised mode, but note that exceptions generated by methods may not be noticed immediately, and debugging code in this state may be confusing.
DefaultCell = Table->getDefaultCell()
Will always wait for the result of the method call.
Methods = Obj->getClass()->getMethods()
Will require two language server call and waits.
Document->open("jpg")
With NoEarlyErrorNotify set this will not wait for a result from the language server.
In the last example, if Document->open() causes an exception, any exception thrown will not be noticed until the next result is returned from the language server. To overcome this, a simple assignment can be used:
Dummy = Document->open("jpg")
Programs run with NoEarlyErrorNotify set should always end with a dummy (or actual) assignment to ensure any errors generated above are caught.