Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

  • Hibernate configuration files are used from an XML format. During installation the respective hibernate configuration file is created and can be manually updated later on.
  • After installation of JOC Cockpit the hibernate.cfg.xml Hibernate configuration file is available in
    • Unix
      • /var/sos-berlin.com/js7/joc/jetty_base/resources/joc
    /hibernate.cfg.xml
    • Windows
      • C:\ProgramData\sos-berlin.com\js7\joc\jetty_base\resources\joc
    • A different location for the configuration directory can be specified during installation of JOC Cockpit.
  • By default the Hikari Connection Pool is used.

...

  • By default the Hikari Connection Pool is used with JS7.
    • The Hikari setting for the maximumPoolSize is included with the Hibernate configuration file as this determines the max. number of open database connections:

      Code Block
      languagexml
      titleHikari Connection Pool recommended settings
      collapsetrue
        <property name="hibernate.connection.provider_class">org.hibernate.hikaricp.internal.HikariCPConnectionProvider</property>
        <property name="hibernate.hikari.maximumPoolSize">10</property>
      
    • Additional property elements can be used to add further settings for Hikari to a Hibernate configuration file.
  • Alternatively e.g. the C3P0 Connection Pool can be used.
    • Use of C3P0 suggests a number of additional settings that better match use with JS7 than the default values:

      Code Block
      languagexml
      titleC3P0 Connection Pool recommended settings
      collapsetrue
        <property name="hibernate.connection.provider_class">org.hibernate.connection.C3P0ConnectionProvider</property>
        <property name="hibernate.c3p0.maxConnectionAge">14400</property>
        <property name="hibernate.c3p0.maxStatementsPerConnection">0</property>
        <property name="hibernate.c3p0.maxStatements">0</property>
        <property name="hibernate.c3p0.checkoutTimeout">0</property>
        <property name="hibernate.c3p0.maxIdleTime">14400</property>
        <property name="hibernate.c3p0.acquireRetryAttempts">1</property>
        <property name="hibernate.c3p0.minPoolSize">5</property>
        <property name="hibernate.c3p0.acquireIncrement">1</property>
        <property name="hibernate.c3p0.statementCacheNumDeferredCloseThreads">1</property>
        <property name="hibernate.c3p0.numHelperThreads">3</property>
        <property name="hibernate.c3p0.idleConnectionTestPeriod">1800</property>
        <property name="hibernate.c3p0.maxPoolSize">10</property>
        <property name="hibernate.c3p0.initialPoolSize">5</property>
    • Additional property elements can be used to add further settings, however, close reading of the C3P0 docs is recommended before applying changes.

Individual JDBC Driver Versions

If you have to use an individual version of a JDBC Driver that is not included with JS7, for example for use with SQL Server® or if you have to use a specific version of the Oracle JDBC Driver®, then you can add the JDBC Driver to JOC Cockpit.

  • Consider that conflicting JDBC Drivers could be included with JS7. Such conflicts can originate from the fact that two JDBC Drivers use the same class name as specified with the hibernate.connection.driver_class attribute value from a Hibernate configuration file.
  • In case of conflicts remove existing JDBC Driver (*.jar) files when adding your version of a JDBC Driver.

When installing or updating JOC Cockpit then you can specify the JDBC Driver that should be used by the installer, for details see

The following chapters explain how to add a JDBC Driver to an existing installation without updating JOC Cockpit from the installer.

Adding a JDBC Driver to an existing Installation on premises

Find JDBC Drivers from the following location of the JOC Cockpit configuration directory:

  • Unix
    • /var/sos-berlin.com/js7/joc/jetty_base/lib/ext/joc
  • Windows
    • C:\ProgramData\sos-berlin.com\js7\joc\jetty_base\lib\ext\joc
  • A different location for the configuration directory can be specified during installation of JOC Cockpit.

From this location you will find the JDBC Driver files indicated with the above table. 

  • Add your JDBC Driver (*.jar) file to this location
  • Optionally remove existing JDBC Driver (*.jar) files from this location, for example to replace the Oracle® JDBC Driver that ships with JS7 by a newer version.

Consider to apply changes to your Hibernate configuration file that reflect change of the JDBC Driver. Find the hibernate.cfg.xm Hibernate configuration file from the JOC Cockpit configuration directory:

  • Unix
    • /var/sos-berlin.com/js7/joc/jetty_base/resources/joc
  • Windows
    • C:\ProgramData\sos-berlin.com\js7\joc\jetty_base\resources\joc
  • A different location for the configuration directory can be specified during installation of JOC Cockpit.

Restart JOC Cockpit to apply your changes.

Adding a JDBC Driver to a Docker® installation

When using the JOC Cockpit Docker® image then technically no installer is included that allows to specify the JDBC Driver to be used. Instead, images are preinstalled. In addition, there is no access to the container's file system before running the container which makes it impossible to add or replace a JDBC Driver before JOC Cockpit is started.

For use with a JOC Cockpit container you can copy the JDBC Driver to the following location:

  • /var/sos-berlin.com/js7/joc/resources/joc/lib
  • The directory /var/sos-berlin.com/js7/joc/resources/joc typically is mounted to a Docker volume when running the container, for details see JS7 - JOC Cockpit Installation for Docker Containers. If the sub-directory lib does not exist then you can create it to store the JDBC Driver (*.jar) file.

Consider to apply changes to your Hibernate configuration file as explained from the previous chapter. Then restart the JOC Cockpit container.

On startup JOC Cockpit checks the above directory for existence of *.jar files. If a JDBC Driver is found then

  • the *.jar file will be copied to ./jetty_base/lib/ext/joc 
  • any existing JDBC Driver *.jar files in this directory are removed.