Platform Explorer / Nuxeo Platform LTS 2016 8.10

Extension point datasources

Documentation

Example contribution:

    <datasource driverClassName="org.apache.derby.jdbc.EmbeddedDriver"
        maxActive="20" maxIdle="5" maxWait="10000" name="jdbc/foo">
        <property name="url">jdbc:derby:/home/db;create=true
          </property>
        <property name="username">nuxeo</property>
        <property name="password">nuxeo</property>
    </datasource>

Or, for a XA datasource:

    <datasource maxActive="20" maxIdle="5" maxWait="10000"
        name="jdbc/foo" xaDataSource="org.apache.derby.jdbc.EmbeddedXADataSource">
        <property name="databaseName">/home/db</property>
        <property name="createDatabase">create</property>
        <property name="user">nuxeo</property>
        <property name="password">nuxeo</property>
    </datasource>

The allowed attributes of a datasource

element are:

  • name the JNDI name (for instance jdbc/foo )
  • driverClassName the JDBC driver class name (only for a non-XA datasource)
  • xaDataSource the XA datasource class name (only for a XA datasource)

To configure the characteristics of the pool:

  • maxActive the maximum number of active connections
  • minIdle the minimum number of idle connections
  • maxIdle the maximum number of idle connections
  • maxWait the maximum number of milliseconds to wait for a connection to be available, or -1 (the default) to wait indefinitely
  • ... see org.apache.commons.dbcp.BasicDataSource setters for more.

To configure the datasource, individual property sub-elements must be used. For a non-XA datasource, url

, username

and password

are commonly used. For a XA datasource, the properties are done according to the JavaBean setters of the datasource, see the documentation for your JDBC driver for more.

Contribution Descriptors

Existing Contributions

Contributions are presented in the same order as the registration order on this extension point. This order is displayed before the contribution name, in brackets.

  • nuxeo-runtime-8.10.jar /Users/arnaud/Work/Nuxeo/distrib/nuxeo-server-8.10-tomcat/nxserver/config/datasources-config.xml
    <extension point="datasources" target="org.nuxeo.runtime.datasource">
        <datasource accessToUnderlyingConnectionAllowed="true" activeTimeoutMinutes="5" blockingTimeoutMillis="1000" driverClassName="org.h2.Driver" idleTimeoutMinutes="5" maxPoolSize="100" minPoolSize="5" name="jdbc/nuxeo" password="********" sqlExceptionSorter="org.nuxeo.runtime.datasource.DatasourceExceptionSorter" url="jdbc:h2:/Users/arnaud/Work/Nuxeo/distrib/nuxeo-server-8.10-tomcat/nxserver/data/h2/nuxeo;DB_CLOSE_ON_EXIT=false" username="sa" validationQuery=""/>
        <link global="jdbc/nuxeo" name="jdbc/NuxeoDS" type="javax.sql.DataSource"/>
        <link global="jdbc/nuxeo" name="jdbc/nxsqldirectory" type="javax.sql.DataSource"/>
        <link global="jdbc/nuxeo" name="jdbc/nxrelations-default-jena" type="javax.sql.DataSource"/>
        <link global="jdbc/nuxeo" name="jdbc/comment-relations" type="javax.sql.DataSource"/>
        <link global="jdbc/nuxeo" name="jdbc/nxaudit-logs" type="javax.sql.DataSource"/>
        <link global="jdbc/nuxeo" name="jdbc/nxjbpm" type="javax.sql.DataSource"/>
        <link global="jdbc/nuxeo" name="jdbc/placeful_service_ds" type="javax.sql.DataSource"/>
        <link global="jdbc/nuxeo" name="jdbc/nxwebwidgets" type="javax.sql.DataSource"/>
        <link global="jdbc/nuxeo" name="jdbc/nxuidsequencer" type="javax.sql.DataSource"/>
        <link global="jdbc/nuxeo" name="jdbc/repository_default" type="javax.sql.DataSource"/>
      </extension>