Oracle FAQ Your Portal to the Oracle Knowledge Grid
HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US
 

Home -> Community -> Usenet -> c.d.o.server -> why donot the oracle function return?

why donot the oracle function return?

From: elaine <elaine_at_foedero.com>
Date: 3 Jan 2002 09:11:30 -0800
Message-ID: <f5601a93.0201030911.5f831c24@posting.google.com>


I define a orcacle java function named oscar_quote and register it to database. When I commented the RMI call in oscar_quote, it works fine. If I uncommented the RMI call, and I called the function on SQL plus command line,it can finish RMI call(I think, because I can see the log information "call com.foedero.cache.Adapter.refreshBox successfully" in "logfile.txt"), but it cannot return(THIS IS THE PROBLEM), it seems locked, at the same time, I tried to "dropJava" Oscar.class from the database, it locked also. I can dropJava Oscar.class successfully until I restarted Orcale. Who can tell me what's the problem? Thanks.

the oscar_quote function is:
CREATE or replace FUNCTION oscar_quote(ename VARCHAR2, job VARCHAR2) RETURN VARCHAR2 AS LANGUAGE JAVA NAME 'Oscar.quote(java.lang.String, java.lang.String) return java.lang.String';"

the oscar.java is:

/**
 * Insert the type's description here.
 * Creation date: (30/12/2001 6:40:18 PM)
 * @author: Administrator
 */

class Oscar {
public synchronized static String quote(String string1, String string2) {

    String bb = "begin ";
    java.io.FileWriter aa = null;
    try {

        aa = new java.io.FileWriter("d:\\logfile.txt", true);
        aa.write("string1=" + string1 + "  String2=" + string2 +
"\r\n");
        aa.flush();

//this is RMI call begin
com.foedero.cache.Adapter.refreshBox(string1, string2, true);
//this is RMI call end
aa.write("call com.foedero.cache.Adapter.refreshBox successfully\r\n"); aa.close(); bb = "successful"; } catch (Exception ex) { ex.printStackTrace(); return ex.toString();

    }
    return bb;
}
} Received on Thu Jan 03 2002 - 11:11:30 CST

Original text of this message

HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US