JIRA
Install
Admin
Use
Search JIRA documentation:

Connecting JIRA to MaxDB

PDF
PDF

MaxDB is the database formerly known as SapDB.

Note
There is one known issue with both MaxDB 7.5 and 7.6: "LONG columns cannot be compared to one another. The contents of LONG columns cannot be compared to character strings or other data types." This kind of query is performed only once within JIRA, in the QuickSearch. This issue only ever affects the QuickSearch when you are searching for JIRA issues that have been moved from their original project to a new project and you are searching on the issue key from the original project. When using MaxDB, the QuickSearch search will report that the JIRA issue does not exist. Full details can be found at JRA-7840.
Note
Before you begin: If you are already using JIRA, create an export of your data as an XML backup. You will then be able to transfer data from your old database to your new database, as described in Switching databases.

1. Configure MaxDB

  1. Create a database user which JIRA will connect as (e.g. jirauser).
  2. Create a database for JIRA to store issues in (e.g. jiradb).
  3. Ensure that the user has permission to connect to the database, and create and populate tables.

2. Copy the MaxDB driver to your application server

  1. Download the JDBC driver from:
  2. Add the MaxDB JDBC driver jar (sapdbc.jar) to the common/lib/ directory.

3. Configure your application server to connect to MaxDB

  1. Edit conf/server.xml (if you are using JIRA Standalone) and customise the username, password, driverClassName and url parameters for the Datasource. (If you are using JIRA WAR/EAR, edit the appropriate file on your application server; e.g. for Tomcat, edit conf/Catalina/localhost/jira.xml.)

    <Server port="8005" shutdown="SHUTDOWN">
    
      <Service name="Catalina">
    
        <Connector port="8080"
          maxHttpHeaderSize="8192" maxThreads="150" minSpareThreads="25" maxSpareThreads="75"
          enableLookups="false" redirectPort="8443" acceptCount="100" 
          connectionTimeout="20000" disableUploadTimeout="true" />
    
        <Engine name="Catalina" defaultHost="localhost">
          <Host name="localhost" appBase="webapps" unpackWARs="true" autoDeploy="true">
    
            <Context path="" docBase="${catalina.home}/atlassian-jira" reloadable="false">
              <Resource name="jdbc/JiraDS" auth="Container" type="javax.sql.DataSource"
                username="[enter db username]"
                password="[enter db password]"
                driverClassName="com.sap.dbtech.jdbc.DriverSapDB"
                url="jdbc:sapdb://localhost/database_name*" 
                [ *see also http://dev.mysql.com/doc/maxdb/en/ef/2de883d47a3840ac4ebb0b65a599e5/content.htm) ]
                [ delete the minEvictableIdleTimeMillis and timeBetweenEvictionRunsMillis params here ]
                />
    
              <Resource name="UserTransaction" auth="Container" type="javax.transaction.UserTransaction"
                factory="org.objectweb.jotm.UserTransactionFactory" jotm.timeout="60"/>
              <Manager className="org.apache.catalina.session.PersistentManager" saveOnRestart="false"/>
            </Context>
    
          </Host>
        </Engine>
      </Service>
    </Server>

    (Note: if you can't find this section at all, you've probably got the wrong file - search for mentions of 'jira' in the files under conf/.)

  2. If you are using JIRA Standalone, edit conf/server.xml, and delete the minEvictableIdleTimeMillis and timeBetweenEvictionRunsMillis attributes (which are only needed for HSQL, and degrade performance otherwise).

4. Configure the JIRA Entity Engine

  1. Edit atlassian-jira/WEB-INF/classes/entityengine.xml (if you are using JIRA Standalone) or edit-webapp/WEB-INF/classes/entityengine.xml (JIRA WAR/EAR), and change the field-type-name attribute to sapdb. (If you forget to do this and start JIRA, it may create database tables incorrectly. See this page if this happens to you.)
    <!-- DATASOURCE - You will need to update this tag for your installation.
    
    -->
      <datasource name="defaultDS" field-type-name="sapdb"
          helper-class="org.ofbiz.core.entity.GenericHelperDAO"
        check-on-start="true"
        use-foreign-keys="false"
        ...
        
    Note
    If you are using JIRA WAR/EAR, your application server may require other changes to entityengine.xml (e.g. to customise the jndi-jdbc tag).
  2. If you are using MaxDB 7.6, specify the schema-name to be the same as your db username:

    <datasource name="defaultDS" field-type-name="sapdb"
                    schema-name="{DB_USER_NAME}"
                    helper-class="org.ofbiz.core.entity.GenericHelperDAO"
                    check-on-start="true"
                    use-foreign-keys="false"
                    use-foreign-key-indices="false"
                    check-fks-on-start="false"
                    check-fk-indices-on-start="false"
                    add-missing-on-start="true"
                    check-indices-on-start="true">

    MaxDB 7.5 does not properly support database schema names. We therefore run into the problem that the JIRA tables are stored at the same level as the system tables of MaxDB. MaxDB contains a system table named VERSION; JIRA also tries to create a table named VERSION. To stop JIRA from usurping the system table you should modify your atlassian-jira/WEB-INF/classes/entitydefs/entitymodel.xml, changing <entity entity-name="Version" table-name="version" package-name=""> to <entity entity-name="Version" table-name="jiraversion" package-name="">. This should be done before you first run JIRA against the database, so that the tables will be created correctly the first time.

    Because JIRA can see all system tables you will notice a warning, such as: Table named "USER_SYS_PRIVS" exists in the database but has no corresponding entity, for each system table. This is not anything to worry about.

    MaxDB 7.6 does not have the same schema problems as 7.5. If you specify the schema name to be the same as your db username (see above), everything will work normally.

Next steps

You should now have an application server configured to connect to a database, and JIRA configured to use the correct database type. If you are using JIRA Standalone, start it up and watch the logs for any errors. If you are using the JIRA WAR/EAR distribution, rebuild and redeploy the webapp in your application server.

User-contributed notes

Have experiences to share with MaxDB and JIRA? We welcome your thoughts. Please see the user-contributed MaxDB notes.