Uploaded image for project: 'Community Edition'
  1. Community Edition
  2. MGNLCE-114

H2 doesn't accept more than one connection anymore


    • Icon: Bug Bug
    • Resolution: Done
    • Icon: Critical Critical
    • 5.5.9, 5.6.2
    • 5.5.7, 5.6
    • None
    • None
    • Yes
    • Yes
    • Basel 128
    • 3

      Our default configuration is not using the server mode and therefore if one tries to initiate a backup call via CLI or REST, it will be failing due to the fact that h2 is not allowing more than one connection at a time.
      Before we didn't have this issue in Magnolia but for some reason (most likely h2 or jackrabbit updates) we have it now. A potential workaround is to run H2 in server mode and hence more than one connection to the DB is allowed.

      <?xml version="1.0" encoding="UTF-8"?>
      <!DOCTYPE Repository PUBLIC "-//The Apache Software Foundation//DTD Jackrabbit 2.0//EN" "http://jackrabbit.apache.org/dtd/repository-2.0.dtd">
        <FileSystem class="org.apache.jackrabbit.core.fs.local.LocalFileSystem">
          <param name="path" value="${rep.home}/repository" />
        <Security appName="magnolia">
          <SecurityManager class="org.apache.jackrabbit.core.DefaultSecurityManager"/>
          <AccessManager class="org.apache.jackrabbit.core.security.DefaultAccessManager">
          <!-- login module defined here is used by the repo to authenticate every request. not by the webapp to authenticate user against the webapp context (this one has to be passed before thing here gets invoked -->
          <LoginModule class="info.magnolia.jaas.sp.jcr.JackrabbitAuthenticationModule">
        <DataStore class="org.apache.jackrabbit.core.data.FileDataStore">
          <param name="path" value="${rep.home}/repository/datastore"/>
          <param name="minRecordLength" value="1024"/>
        <Workspaces rootPath="${rep.home}/workspaces" defaultWorkspace="default" />
        <Workspace name="default">
          <FileSystem class="org.apache.jackrabbit.core.fs.local.LocalFileSystem">
            <param name="path" value="${wsp.home}/default" />
          <PersistenceManager class="org.apache.jackrabbit.core.persistence.bundle.H2PersistenceManager">
            <param name="url" value="jdbc:h2:${wsp.home}/db;DB_CLOSE_ON_EXIT=FALSE;AUTO_SERVER=TRUE" />
            <param name="schemaObjectPrefix" value="pm_${wsp.name}_" />
          <SearchIndex class="org.apache.jackrabbit.core.query.lucene.SearchIndex">
            <param name="path" value="${wsp.home}/index" />
            <!-- SearchIndex will get the indexing configuration from the classpath, if not found in the workspace home -->
            <param name="indexingConfiguration" value="/info/magnolia/jackrabbit/indexing_configuration.xml"/>
            <param name="useCompoundFile" value="true" />
            <param name="minMergeDocs" value="100" />
            <param name="volatileIdleTime" value="3" />
            <param name="maxMergeDocs" value="100000" />
            <param name="mergeFactor" value="10" />
            <param name="maxFieldLength" value="10000" />
            <param name="bufferSize" value="10" />
            <param name="cacheSize" value="1000" />
            <param name="forceConsistencyCheck" value="false" />
            <param name="autoRepair" value="true" />
            <param name="queryClass" value="org.apache.jackrabbit.core.query.QueryImpl" />
            <param name="respectDocumentOrder" value="true" />
            <param name="resultFetchSize" value="100" />
            <param name="extractorPoolSize" value="3" />
            <param name="extractorTimeout" value="100" />
            <param name="extractorBackLogSize" value="100" />
            <!-- needed to highlight the searched term -->
            <param name="supportHighlighting" value="true"/>
            <!-- custom provider for getting an HTML excerpt in a query result with rep:excerpt() -->
            <param name="excerptProviderClass" value="info.magnolia.jackrabbit.lucene.SearchHTMLExcerpt"/>
            <AccessControlProvider class="info.magnolia.cms.core.MagnoliaAccessProvider" />
        <Versioning rootPath="${rep.home}/version">
          <FileSystem class="org.apache.jackrabbit.core.fs.local.LocalFileSystem">
            <param name="path" value="${rep.home}/workspaces/version" />
          <PersistenceManager class="org.apache.jackrabbit.core.persistence.bundle.H2PersistenceManager">
            <param name="url" value="jdbc:h2:${rep.home}/version/db;DB_CLOSE_ON_EXIT=FALSE;AUTO_SERVER=TRUE" />
            <param name="schemaObjectPrefix" value="version_" />

      Side note: Not sure DB_CLOSE_ON_EXIT=FALSE; is needed and most likely not.

        Acceptance criteria

              ilgun Ilgun Ilgun
              ilgun Ilgun Ilgun
              0 Vote for this issue
              2 Start watching this issue