Dieser Inhalt ist in der von Ihnen ausgewählten Sprache nicht verfügbar.
5.4. Changing the Database
JMS uses the database defined in
jboss-as/server/$PROFILE/deploy/messaging/<DATABASE_TYPE>-persistence-service.xml
as a persistence storage. The default persistence storage type is Hypersonic (HSQLDB) defined in hsqldb-persistence-service.xml
. Note that the configuration is defined for a clustered environment (<attribute name="Clustered">true</attribute>
).
Warning
Although Hypersonic configuration is used as the default persistence configuration, Hypersonic is not suitable or supported in production due to the following known issues:
- no transaction isolation
- thread and socket leaks (
connection.close()
does not tidy up resources) - persistence quality (logs commonly become corrupted after a failure, preventing automatic recovery)
- database corruption
- stability under load (database processes cease when dealing with too much data)
- not viable in clustered environments
The Hypersonic database is intended for developing and testing purposes and should not be used in a production environment. For more information about recommended databases, refer to the Using Other Databases chapter in the Getting Started Guide.
The Persistence Manager, Post Office and JMS User Manager all interact with persistent storage. The Persistence Manager handles message-related persistence. The Post Office handles binding related persistence. The JMS User Manager handles user-related persistence. All configuration for these managed beans is handled in the
<your database type>-persistence-service.xml
file.
Example configuration files for MySQL, Oracle, PostgreSQL, Microsoft SQL Server or Sybase databases are available in the
$JBOSS_HOME/docs/examples/jms
directory of the release bundle.
To enable your database, replace the default
$JBOSS_HOME/server/$PROFILE/deploy/messaging/hsqldb-persistence-service.xml
configuration file with the configuration file for your database type. Restart the server to apply the new persistence configuration.
Apart from the unsupported Hypersonic configuration, the example configurations are by default set for non-clustered environments. To allow clustered environments for your database configuration, set the Clustered attribute to
true
in <your database type>-persistence-service.xml
(the default setting is <attribute name="Clustered">false</attribute>).
Note
The structure of the persistence configuration file changed in JBoss Enterprise Application Platform 5.1.0 so it's necessary to again copy an example configuration file for your database configuration and edit it to suit your environment. Failure to do so will cause deployment/startup problems.
By default, the messaging services rely on a data store reference
java:/DefaultDS
for the data source. To deploy a data source with a different JNDI name, you must update all DataSource
attributes in the persistence configuration file. Example data source configurations are included in the distribution.