Customizing a Naggregator w/ HSQLDB Binding

The 'factory setting'

In the default incarnation, the EAR contains a configuration that creates a non-persistent database backend which is reset upon a redeployment of the application or a restart of the JBoss server.

Configuring a persistent database

Open naggregator.ear/nag-storage-hsqldb-VERSION.sar/META-INF/jboss-service.xml, make sure that the file contains these settings:

<mbean code="org.jboss.jdbc.HypersonicDatabase" name="jboss:service=Hypersonic,database=nagdb">
                <attribute name="Port">17010</attribute>
                <attribute name="BindAddress">${jboss.bind.address}</attribute>     
                <attribute name="Database">nagdb</attribute>
                <attribute name="Silent">true</attribute>
                <attribute name="Trace">true</attribute>
                <attribute name="InProcessMode">false</attribute>
</mbean>

Open naggregator.ear/nag-storage-hsqldb-VERSION.sar/META-INF/datasource-ds.xml, make sure that the file contains these settings:

<local-tx-datasource>
        <jndi-name>NaggregatorDS</jndi-name>
        <connection-url>jdbc:hsqldb:${jboss.server.data.dir}${/}hypersonic${/}nagdb</connection-url>
        <driver-class>org.hsqldb.jdbcDriver</driver-class>
        <user-name>sa</user-name>
        <password></password>
        <min-pool-size>5</min-pool-size>
        <max-pool-size>20</max-pool-size>
        <idle-timeout-minutes>0</idle-timeout-minutes>
        <track-statements/>
        <metadata>
                <type-mapping>Hypersonic SQL</type-mapping>
        </metadata>
        <depends>jboss:service=Hypersonic,database=nagdb</depends>
</local-tx-datasource>

Afterwards, copy nagdb.properties and nagdb.script from the folder naggregator.ear/nag-storage-hsqldb-VERSION.sar/hsqldb/ into the JBoss instance at $JBOSS_HOME/server/$YOUR_PROFILE/data/hypersonic as the database will expect the actual context at this position. At this very place your database content will be held persistent. Please stop the application server before copying the files into the JBoss space.