0
votes

We need to run a Java program from within an Oracle database, so we are considering using a Java Stored Procedure. The question is what happens in terms of scalability since we are going to have many concurrent executions.

(1) Will it create a new "java" process for each call made to the procedure, meaning it will startup a new JVM instance? Or (2) Will Oracle DB manage the code and use a shared JVM for running the program?

I believe and hope the option 2 is likely to be the correct one, but I was not able to find any document that can answer this question so we can proceed safely.

1
To the best of my knowledge it uses a shared VM. I am also looking for the specification to back my statementRaghu K Nair

1 Answers

0
votes

After some google I found out that in fact Java Stored Procedures are optimized and interoperable, executing in the same Oracle JVM that ships with the database.

Code is integrated using the Just-in-Time Compiler (JIT), since 11.1. Detailed information about non-functional requirements can be found in the Developing Java Stored Procedures guide.

Unlike a wrapper, which adds another layer of execution, a call specification publishes the existence of a Java method. As a result, when you call the method through its call specification, the run-time system dispatches the call with minimal overhead.

And the FAQ:

Java Stored procedures are executed by the database JVM in database memory space.