3 Replies Latest reply on Sep 8, 2006 2:19 AM by Brian Greene

    In-process HSQLDB

    Andy Yang Newbie

      Hi there,

      Can anyone point me to how to configure JBPM to run with a "totally in-memory" HSQLDB instance?

      In the hsqldb-ds.xml, the default config in the starter's kit is for the persistent db:

      <connection-url>jdbc:hsqldb:${jboss.server.data.dir}${/}hypersonic${/}localDB</connection-url>


      Simply uncommenting

      <connection-url>jdbc:hsqldb:.</connection-url>
      doesn't get the database schema created/populated during startup.

      Adding

      <property name="hibernate.hbm2ddl.auto">update</property>
      to hibernate.cfg.xml in jbpm.sar doesn't seem to work (and is probably not the right thing to do anyways). However, I can't find a hibernate.properties anywhere in the starter kit.

      Thanks,
      Andy


        • 1. Re: In-process HSQLDB
          Brian Greene Newbie

          don't recall the exact setting, but you'll need to add "mem" to the connection URL - this indicates to HSQL that you want full in-memory mode. Not sure what to do in JBoss specifically, but this is how we run our unit/integration tests.

          • 2. Re: In-process HSQLDB
            Andy Yang Newbie

            The hsqldb-ds.xml file included in the starter kit includes a commented-out line to set up the in-memory database:

            <connection-url>jdbc:hsqldb:.</connection-url>


            But I also did try replacing it with:

            <connection-url>jdbc:hsqldb:mem:.</connection-url>


            Both seem to work in terms of creating an HSQL instance. I assume it's in-memory because I don't think I can connect to it using the HSQL management client.

            However, my problem is that I don't know how to initialize this environment once it does get started.

            None of the tables are populated with the demo data, and without the client, I'm not sure I can manually insert or run scripts. I'm not even sure the jBPM tables have been created: during JBoss startup, all of the tables are reported as "not found" but I'm not sure if they've been created or not as part of startup.


            • 3. Re: In-process HSQLDB
              Brian Greene Newbie

              to do it with an in mem db you'll also have to set the hibernate config to autocreate the tables for you. see the hibernate docs on how to do this.