public class Invocation extends ObjectOne invocation, from PostgreSQL, of functionality implemented using PL/Java.
This class is the Java counterpart of the
struct Invocation_in the C code, but while there is a new stack-allocated C structure on every entry from PG to PL/Java, no instance of this class is created unless requested (with
current(); once requested, a reference to it is saved in the C struct for the duration of the invocation.
One further piece of magic applies to set-returning functions. Under the value-per-call protocol, there is technically a new entry into PL/Java, and a new C
Invocation_struct, for every row to be returned, but that low-level complication is hidden at this level: a single instance of this class, if once requested, will be remembered throughout the value-per-call sequence of calls.
- Thomas Hallgren
public int getNestingLevel()
- The nesting level of this invocation
public void onExit(boolean withError) throws SQLExceptionCalled from the backend when the invokation exits. Should not be invoked any other way.
public static Invocation current()
- The current invocation