The Java virtual machine tracks the object references that you use in native methods, such as COBOL methods. This tracking ensures that the objects are not prematurely released during garbage collection.
There are two classes of such references:
The following object references are always local:
You can pass either a local reference or a global reference as an object reference argument to a JNI service.
You can code methods to return either local or global references as RETURNING values. However, in either case, the reference that is received by the invoking program is a local reference.
You can pass either local or global references as USING arguments in a method invocation. However, in either case, the reference that is received by the invoked method is a local reference.
Local references are valid only in the thread in which you create them. Do not pass them from one thread to another.