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

H2 doesn't accept more than one connection anymore

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Critical
    • Resolution: Done
    • Affects Version/s: 5.5.7, 5.6
    • Fix Version/s: 5.5.9, 5.6.2
    • Component/s: None
    • Labels:
      None
    • Release notes required:
      Yes
    • Documentation update required:
      Yes
    • Sprint:
      Basel 128
    • Story Points:
      3
    • Magnolia Release:
      5.5.9, 5.6.2

      Description

      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">
      <Repository>
        <FileSystem class="org.apache.jackrabbit.core.fs.local.LocalFileSystem">
          <param name="path" value="${rep.home}/repository" />
        </FileSystem>
        <Security appName="magnolia">
          <SecurityManager class="org.apache.jackrabbit.core.DefaultSecurityManager"/>
          <AccessManager class="org.apache.jackrabbit.core.security.DefaultAccessManager">
          </AccessManager>
          <!-- 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">
          </LoginModule>
        </Security>
        <DataStore class="org.apache.jackrabbit.core.data.FileDataStore">
          <param name="path" value="${rep.home}/repository/datastore"/>
          <param name="minRecordLength" value="1024"/>
        </DataStore>
        <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" />
          </FileSystem>
          <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}_" />
          </PersistenceManager>
          <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"/>
          </SearchIndex>
          <WorkspaceSecurity>
            <AccessControlProvider class="info.magnolia.cms.core.MagnoliaAccessProvider" />
          </WorkspaceSecurity>
        </Workspace>
        <Versioning rootPath="${rep.home}/version">
          <FileSystem class="org.apache.jackrabbit.core.fs.local.LocalFileSystem">
            <param name="path" value="${rep.home}/workspaces/version" />
          </FileSystem>
          <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_" />
          </PersistenceManager>
        </Versioning>
      </Repository>
      
      

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

        Attachments

          Issue Links

            Activity

              People

              • Assignee:
                ilgun Ilgun Ilgun
                Reporter:
                ilgun Ilgun Ilgun
              • Votes:
                0 Vote for this issue
                Watchers:
                2 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved:
                  Date of First Response: