Sunday, February 27, 2011

Oracle: PL/SQL vs Java - one unconventional question

All the time since the introduction of Java engine within Oracle RDBMS people have been wondering how performance of Java stored procedures compare to orthodox ones written in PL/SQL. There are lots of performance tests demonstrating where things stand. Surprise! I am not going to discuss it here. What I am really curious about is what we may expect in future. Might it happen that one day PL/SQL will be fully replaced with the Java engine?

Wednesday, February 9, 2011

jvisualvm from jdk1.6.0_22 crashes on my Vista x64

Just discovered that jvisualvm.exe from jdk1.6.0_22 crashes with no apparent reason while starting up on my Vista x64 laptop. This is quite weird as yesterday I managed to start it many times without a problem, although there were two or three crashes. Not sure what has happened. Assuming that some of plug-ins may be corrupt I tried to remove the configuration under Application Data\.visualvm\6u20 folder. It started well a few times then again rejected to start. The same utility from jdk1.6.0_16 seems to operate well.
I am going to upgrade to jdk1.6.0_23 and see whether it solves the problem.

UPD Seems it is more stable in jdk1.6.0_23.
UPD #2 Here VisualVM dev team mention a Java bug that affects 64bit systems and they suggest adding "-J-Dsun.java2d.d3d=false" to the command line as a solution.
UPD #3 In JDK1.6.0_23 this option is already provided by default in ${JDK_HOME}\lib\visualvm\etc\visualvm.conf.

Friday, February 4, 2011

Why no ClassShutter in Java6 JS engine?

There is one thing about Java6 I am in a way baffled by. As far as I remember the JavaScript scripting engine in Java6 has been based on Mozilla Rhino. How did it happen that the implementation in Java6 is missing the original Rhino functionality for restricting the set of classes that may be loaded by a script?

I assume the feature has been replaced by allowing a custom implementation of java.lang.ClassLoader in one of javax.script.ScriptEngineManager constructors. This offers unlimited flexibility for other scripting engines that might be plugged in the JVM instance. Then another question - is there any built-in ClassLoader in Java6 that supports class filtering? Because of safety reasons it is quite natural to limit the set of classes loadable by scripting extensions. However it seems there is no standard or default way to do that. So everybody willing to ensure better control over the extension scripts has to build their own implementation of essentially the same functionality. Not quite encouraging.