Monday, July 6, 2009

"I'm pleased to announce availability [1] of the first test version ofFB/Java plugin.

FB/Java is a plugin for FB external engines feature, to be presented inv3.0, that allows execution of Java code at the server side. The pluginallows classes/resources in the file system or stored in the database.File system classes/resources are global and the code run with allpermissions. Database classes/resources are per-database and code runsaccordingly with per-engine configured security policy.

The plugin has been made with the assumption that anything could be doneusing existing FB infrastructure. You don't need to setup FTP server orshared directory in the server to update your code or edit security police.

Installation/update of database JARs works from client command lineutility or from SQLJ package procedures. Actually, the same Java classthat run in the client is the one that runs in the server. You can putJARs in the database using a Java URL, so lookup of them is notrestricted to client or server.

Security handling is configured in a central database, with a singlePERMISSION table. Permissions are granted to users that executes theJava code. This way to configure permissions is not adequate for every(or most) cases, and roles are not supported at the moment. I supposeand desire we can have a better design in the future, before a finalrelease.

It's welcome any attempt to bypass the security system. But please,report it. :-)

This version also lacks some notification mechanism for when the codeare going to be unloaded. You may note the problem in the example, rightafter disconnect all attachments from the database the log file remainslocked, as it wasn't been garbaged collected. And no kind of "hotredeployment" support had been implemented or tested. However, I haveideas of how these problems can be solved in very good ways, based onexisting models. For unloading (or any other type of notification),JPA-like listeners. For maintain state after redeployments, serializablesessions.

In the file plugins\java-engine\examples\fbjava\README, you foundinstructions for a "quick start" with it. Inplugins\java-engine\examples\tests there are functional tests for manyof its feature (i.e., how type mappings works, etc).

The plugin is based on Jaybird 2.2 (HEAD). I've put it in a mavenrepository at [2], with its version defined as 2.2-jrt-SNAPSHOT.

The server includes my v3.0 changes, supporting packages, DDL triggers,over clause and some internal changes. It may have others instabilities.

If you have a JAVA_HOME environment variable defined, it should justworks without any other configuration. The quick start assumes you haddefined FIREBIRD, ISC_USER and ISC_PASSWORD. In [1], I've zipped pluginand engine together, but plugin installation consists in just unpackingit in FB directory.

Documentation has room for improvements, and is at [3]. I've done itwith FB docbook tools.