ORA_JAVA.NEW_GLOBAL_REF
built-in functionThis function returns a reference handle that can be used as a global variable
to reference an object of type ORA_JAVA.JOBJECT
.
FUNCTION ORA_JAVA.NEW_GLOBAL_REF(
obj IN ORA_JAVA.JOBJECT)
RETURN ORA_JAVA.JOBJECT;
Parameter |
Description |
|
A valid instance of the Java class you want to create
a global reference to. The actual parameter can be any object of type
|
An object of the PL/SQL type ORA_JAVA.JOBJECT
.
Use this built-in when you want an object to persist beyond the duration of the PL/SQL trigger in which it was created. This is the only mechanism that will create a persistent Java object. It must be used for objects whose scope is larger than the PL/SQL trigger.
The object that you want to create a global reference to must be valid.
The reference handle created remains active until it is explicitly deleted
by ORA_JAVA.DELETE_GLOBAL_REF
.
This means the same object can be used in many trigger points.
PROCEDURE foo IS
obj ORA_JAVA.JOBJECT;
...
BEGIN
obj := myclass.new;
mypkg.instobj := ORA_JAVA.NEW_GLOBAL_REF(obj);
...
END;
Controlling Java Object Persistence
Copyright © 1984, 2005, Oracle. All rights reserved.