Shared data sources in Plexus Connect

    With high number of IJC schemas in one database/database schema, which are accessed by Plexus Connect simultaneously, the number of connections between the application and database might rise to a number which affects performance. Since 16.5.23.0 version of Plexus it is possible to share a fixed number of connections among all IJC schemas accessed by Plexus.

    {warning} The database connections can only be shared among IJC schemas loaded from the same database schema.

    The database connection and connection pool parameters are defined in *.ijs properties file. Each *.ijs file defines connection to a single IJC schema. If you want to share database connections among multiple IJC schemas opened in Plexus you have make sure that their respective .ijs files contain exactly the same connection and connection pool parameters. The connection and connection pool parameters are those starting with `'database.'and'custom.connection.pool.'prefixes. If you have your IJC schemas in Oracle database there are several extra connection parameters that start with'oracle.net.'` prefix.

    Please refer to Edit Schema Connection Settings for detailed description of the connection and connection pool parameters. The most important ones that you are likely to set up are 'maxActive' and 'maxWait' parameters. The optimum values for mid-size Plexus installations are listed below.

    <entry key="custom.connection.pool.maxActive">19</entry>
    
    <entry key="custom.connection.pool.maxWait">100000</entry>

    {primary} Please note all the *.ijs files that are supposed to share the same connection pool must contain the same connection parameters with the same values.

    The sharing of the connection pool (data source) in Plexus is controlled by the ' ijc.reuse.datasource ' JVM startup parameter. This parameter is set to 'false' by default and the sharing is turned off. If you want your Plexus server to share the data source (connection pool) among multiple IJC schemas please set the parameter to 'true' when starting up your Plexus server. The command for starting up Plexus using embedded Jetty server might look like the one below.

    java -Xmx2096m -XX:+UseConcMarkSweepGC -XX:+CMSClassUnloadingEnabled -Dijc.reuse.datasource=true -jar plexus-suite.war

    When using Tomcat, you can add this parameter to the setenv.sh on Unix systems (or setenv.bat on Windows machines) script inside your Tomcat’s bin directory. The parameters to be set for the previous command would look like the following.

    -server\
    -Xmx2096m\
    -XX:+UseConcMarkSweepGC\
    -XX:+CMSClassUnloadingEnabled\
    -Dijc.reuse.datasource=true

    For more details on the use of setenv script, please refer to the Tomcat documentation.