Version 5

    Changing the database used by JBoss Messaging


    By default JBoss Messaging uses hsqldb for persistence.




    Critique of hsqldb - hypersonic


    Still the same ones




    Steps to change the database


    • Deploy the datasource for your database

    • Use an alternate persistence schema to jboss-messaging.sar/hsqldb-persistence-service.xml




    Deploy the datasource for your database


    There are example datasources in docs/examples/jca. An XA datasource is not required for JBoss Messaging persistence. All work is done is separate transactions that only includes work on the JBoss Messaging tables. i.e. there is a single branch so there is no need for two phase commit.


     - Copy docs/examples/jca/xxx-ds.xml to deploy
     - Configure the datasource (server url, user, password, etc...)
     - Remove deploy/hsqldb-ds.xml



    NOTE-READ THIS!!!: Other services such as the TimerService or the HiLo generator are relying on an existing datasource deployed with jndi name "DefaultDS".


    Therefore either you update the relevant configuration xml files with the jndi name of the actual datasource deployed e.g. "MyDS" or you are using "DefaultDS"


    NOTE - Read this as well: The example mysql-ds.xml file provided under the docs/examples/jca/ directory does not specify the transaction isolation level. You need to add the following:


    to the mysql-ds.xml file, inside the <local-tx-datasource> tag. Otherwise, you will still going to see the complaints spit out by the messaging service when it starts, saying the DataSource transaction level is set to NONE.




    Changing the persistence configuration


    Alternate persistence configurations can be found in src/etc/server/default/deploy,

    in this document Oracle is assumed.


     - Copy src/etc/server/default/deploy/oracle-persistence-service.xml to deploy/jboss-messaging.sar
     - Remove deploy/jboss-messaging.sar/hsqldb-persistence-service.xml



    Other considerations


    As noted in the persistence configuration the schema created by JBossAS is not optimized. You may want to create the schema by hand in the database. This will also include creating additional and database-specific indexes.




    Referenced by: