Jserver
is the new java engine in the Oracle 8i Database.
The architecture is so unique that it makes the
large foot print of the Java Virtual Machine and
lack of scalability in Java, a thing of the past.
Java applications can now inside the database unlike
some competing technologies where the java process
runs out of the database and use the shared memory
inside the database.
What more does an ebusiness
engine need?. Oracle's product comes with built
in Java VM, EJB support, Corba Compliant ORB, Built
in JDBC and SQLJ it comes with support for Java
Beans Server, JDBC, SQLJ, Enterprise. More over
oracle just released its XML tool kit that allows
standard sql to return XML Documents. This toolkit
is available for free on its technet.oracle.com
website.
The oracle 8i server has
a foot print of 40kb for each Java Virtual
Machine, and it there by allows the server to run
thousands of virtual machines. So, oracle can run
individual virtual machines for individual sessions
and scale up to 1000's of transactions without having
to code threads in the application logic. Speed
is handled by native compilation. The Java Server
Program, as well as all of the supporting Java classes
are compiled to C and then dynamically linked into
the server kernel for execution.
Once initialized, the JVM is called the Aurora JVM
($ORACLE_HOME/javavm/lib/aurora.zip) which in Oracle
v8.1.5 is compliant with Sun Microsystems JDK v1.1.6
. The Aurora JVM actually runs in the same process
and address space as the Oracle kernel, sharing
memory heaps and therefore directly accessing its
relational data. The DBA has no real way of tuning
the Java Shared Pool apart from increasing its size,
tuning MTS (used to communicate to EJB's) and working
with two other parameters, Java_soft_sessionspace_limit
and Java_max_sessionspace_size.
Getting Started
Jserver comes with the oracle
8i Enterprise Server and if you install a typical
or custom seed database, the setup routines automatically
initialize, configure and enable java in the database.
Since we typically do not use seed databases, lets
see how to initialize the Java VM in the database.
There are a few things that
you need to set before you initialize the Jserver
manually.
Java_shared_pool must be >= 20Mb
compatible 8.1.0
shared_pool_size >= 50Mb
Intialize the VM
To initialize the Java vm, connect
to the database as internal and then run the initjvm.sql
file located in the ORACLE_HOME/javvm/install directory.
This SQL Script loads and resolves the classes for
the Java Run Time, Java Compiler, JDBC, Bytecode
Verifier, Optimizer, Aurora ( Code name for Javavm
), ORB, EJB, SQLJ and other supporting packages
like DBMSJava. The class files are stored in a proprietary
format at ORACLE_HOME/javavm/admin/classes.bin.
Source code for these classes is available in ORACLE_HOME/javavm/lib.
Dont worry about the source unless you really want
to delve into the details. Running on a mid range
server, it took me 12 Minutes to initialize the
classes.
Init.ora Parameters and their
Effects
Shared_Pool_Size and Java_Pool_Size,
affect the performance of the Java VM. Shared pool
is used transiently when LoadJava is used to load
classes etc. The Memory manager in the JVM allocates
memory from the Java_Pool_Size during runtime to
manage java state. In case of MTS the Java_Pool_Size
has to be adjusted based on the amount of static
session variables held in the pool.
Java_Soft_Sessionspace_Limit
and Java_Max_Sessionspace_Size parameters are useful
to control the memory usage. Java_Soft_Sessionspace_Limit
with a default value of 1M, allows you to set a
soft limit on java memory usage in a session and
it generates a warning in the trace file when a
user's session state exceeds this value. Java_Max_Sessionspace_Size
sets a hard limit and kills the program when the
Java state exceeds this size.
DBAsupport.com Home Page