3.4. FAQs of database configuration

Q1. How to configure eXo Platform to connect to other database systems?

Configuring eXo Platform to connect to other database can be done easily by reusing sample configurations provided in the package.

For Tomcat, sample configuration files are:

For JBoss, configurations are pre-defined in the $PLATFORM_JBOSS_HOME/standalone/configuration/standalone-exo.xml file. You just need to uncomment them for use.

Q2. How to remove the idle MySQL connections?

Some RDBMSs, like MySQL, close the idle connections after a period (8 hours on MySQL by default). Thus, a connection from the pool will be invalid and any application SQL command will fail, resulting in errors as below:

org.hibernate.SessionException: Session is closed!
at org.hibernate.impl.AbstractSessionImpl.errorIfClosed(AbstractSessionImpl.java:72)
at org.hibernate.impl.SessionImpl.getTransaction(SessionImpl.java:1342)

To avoid this, you can use DBCP to monitor the idle connections and drop them when they are invalid, with the testWhileIdle, timeBetweenEvictionRunsMillis, and validationQuery parameters.

The validation query is specific to your RDBMS. For example, on MySQL, you would use:

testWhileIdle="true" timeBetweenEvictionRunsMillis="300000" validationQuery="SELECT 1"

In which:

For more details on the configuration, or some examples on other RDBMS and applications servers, refer to the following websites:

Q3. How to enable managed DataSource?

In JBoss, when you want to use a managed data source, set "true" for the gatein.jcr.datasource.managed property in the $PLATFORM_JBOSS_HOME/standalone/configuration/gatein/configuration.properties file.

gatein.jcr.datasource.managed=true
Copyright ©. All rights reserved. eXo Platform SAS
blog comments powered byDisqus