External Plug-ins
Firebird default head
Sourceforge CCA Awards 2009

External Plug-ins

  • External Java Procedures

  • Sub-Project details

    Leaders:
  • Adriano dos Santos Fernandes

    Members:

  • Adriano dos Santos Fernandes

    Mail traffic:

  • Firebird Developers' Lab
  • Firebird-Java

  • Firebird Sub-projects

  • Firebird Documentation
  • Firebird Core Engine
  • InterClient/InterServer
  • JDBC driver type 4
  • Firebird .NET provider
  • Firebird ODBC driver
  • Firebird Engine Plug-ins
  • Firebird Platform Porting
  • Firebird Driver for Python
  • Firebird QA
  • Core Technical Docs
  • Firebird Website

  • External Java Procedures Plug-in

    Adriano dos Santos Fernandes, 6 July 2009

    I'm pleased to announce that the first test version of my Firebird/Java plugin ("FB/Java") is available to test. FB/Java is a plugin for the Firebird "external engines" feature to be introduced in v3.0, that allows execution of Java code at the server side.

    The plugin allows classes/resources to be located in the file system or stored in the database:

    • File system classes/resources are global and the code runs with all permissions.
    • Database classes/resources are per-database and code runs according to the security policy configured for the engine.

    The plugin has been made with the assumption that anything could be done using the existing Firebird infrastructure. It would not be necessary to set up an FTP server or a shared directory in the server in order to update your code or edit the security policy.


    Download the Fb/Java Plug-in and server for 32-bit Windows.

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

    The plug-in and the engine are zipped together, but the plug-in installation is just a matter of unpacking it into the Firebird directory.


    Installation and Examples

    Installation/update of database JARs works from the client command line utility or from SQLJ package procedures. Actually, the same Java class that run in the client is the one that runs in the server. You can express the locations of JARs in the database using a Java URL, so looking them up is not restricted to the location of the client or the server.

    In the file plugins\java-engine\examples\fbjava\README, you will find instructions for a "quick start" with Fb/Java. If you have a JAVA_HOME environment variable defined, it should just work without any other configuration. In plugins\java-engine\examples\tests there are functional tests for many of its features (i.e., how type mappings works, etc).

    The quick start assumes FIREBIRD, ISC_USER and ISC_PASSWORD are defined.

    Documentation

    Documentation (with room for improvements!) was done with the Firebird DocBook tools. A copy is in the download kit. You can also download it separately.

    Shortcomings

    Listed here are some of the shortcomings of this version:

    • Security handling is configured in a central database, with a single PERMISSION table. For now, permissions are granted to the user that executes the Java code. This way to configure permissions is not adequate for all, or even most cases, and roles are not supported at the moment. I hope and expect that we can look forward to a better design before a final release.
      You are welcome to try to bypass the security system. Please report any successful attempts to the firebird-devel list.
    • This version also lacks any notification mechanism for when the code is about to be unloaded. In the example, you may notice that, right after disconnecting all attachments from the database, the log file remains locked, as though it wasn't being garbaged collected.
       
    • No kind of "hot redeployment" support had been implemented or tested yet.

    I have some ideas about good solutions to the latter two problems, based on existing models:

    • JPA-like listeners for unloading (or any other type of notification)
    • Serializable sessions for maintaining state after redeployments

    SVN Repository

    Source code is in https://firebird.svn.sourceforge.net/svnroot/firebird/java-plugin/tags/2.2-jrt-M1.

    The plugin is based on Jaybird 2.2 (HEAD).

    I've put a snapshot in a maven repository, with its version defined as 2.2-jrt-SNAPSHOT.

    Back to Core Engine index page.

    Get Firebird at SourceForge.net. Fast, secure and Free Open Source software downloads This site and the pages contained within are Copyright © 2000-2010, Firebird Project.
    Firebird® is a registered trademark of Firebird Foundation Incorporated.