Announcement Announcement Module
No announcement yet.
JPOX, HSQLDB and Spring Page Title Module
Move Remove Collapse
Conversation Detail Module
  • Filter
  • Time
  • Show
Clear All
new posts

  • JPOX, HSQLDB and Spring

    I'm seeing a wierd combination of things in Equinox when using HSQLDB, JPOX and Spring:

    First of all, my JDBC URL for my HSQLDB database is set at:


    I'm using HSQLDB version 1.7.1 because I've found when I upgrade to 1.7.3, my jWebUnit tests quit working (because of a file lock error).

    JPOX 1.1.0-beta-1 + Spring 1.1.3 + HSQLDB 1.7.1 = works fine
    JPOX 1.1.0-beta-1 + Spring 1.1.4 + HSQLDB 1.7.1 = results in the following error:

        [junit] (JDO operation): data integrity violated by SQL ''; nested exception
     is java.sql.SQLException: Try to insert null into a non-nullable column in statement [INSERT INTO APP_USER (FIRST_NAME,LAST_NAME,BIRTHDAY,ID) VALUES ('Rod','Johnson',NULL,NULL)]
    JPOX 1.1.0-beta-1 + Spring 1.1.4 + HSQLDB 1.7.3 = results in the following error:

        [junit] NestedThrowables:
        [junit] java.sql.SQLException: The database is already in use by another pro
    cess: [email protected][file =C:\Source\equinox\extras\jdo\db\equinox.lck, exists=true, locked=false, valid=false, fl =null]: java.lang.Exception:
     The process cannot access the file because another process has locked a portion
     of the file : C:\Source\equinox\extras\jdo\db\equinox.lck
    So it seems there's an issue with HSQLDB 1.7.1 and Spring 1.1.4. Everything works fine with 1.1.3. For good meaure, I tried a spring.jar built from CVS and I got the same error. Strangely enough, this seems to only be an issue with JPOX - all other persistence packages (Hibernate, Spring JDBC, iBATIS and OJB) work fine with HSQLDB 1.7.1 and Spring 1.1.4.

    My package.jdo file looks as follows:

    <?xml version="1.0"?>
        "-//Sun Microsystems, Inc.//DTD Java Data Objects Metadata 2.0//EN" 
        <package name="org.appfuse.model">
            <class name="User" identity-type="application"
                <field name="id" primary-key="true"/>
                <field name="firstName" persistence-modifier="persistent">
                    <column name="first_name" jdbc-type="VARCHAR" length="50"/>
                <field name="lastName" persistence-modifier="persistent">
                    <column name="last_name" jdbc-type="VARCHAR" length="50"/>
                <field name="birthday"/>
                <extension vendor-name="jpox" key="use-poid-generator" value="true"/>
    For now, I guess I'll just stick with Spring 1.1.3 with JPOX and HSQLDB 1.7.1. A better solution would probably be to figure out the lock problem with 1.7.3 or use some other in-memory database.

  • #2
    Thanks Andy - this is what I ended up doing and it solved the problem.