JNDI database connection needs an update after Upgrade to JIRA 7.x or above
Platform notice: Server and Data Center only. This article only applies to Atlassian products on the Server and Data Center platforms.
Support for Server* products ended on February 15th 2024. If you are running a Server product, you can visit the Atlassian Server end of support announcement to review your migration options.
*Except Fisheye and Crucible
The content on this page relates to platforms which are not supported for JIRA Applications. Consequently, Atlassian cannot guarantee providing any support for it. Please be aware that this material is provided for your information only and using it is done so at your own risk.
Problem
Prior to JIRA 6, JNDI database connection works fine. After JIRA 7 upgrade, the following appears in the atlassian-jira.log
:
2017-07-11 21:39:03,583 localhost-startStop-1 WARN [tomcat.dbcp.dbcp2.BasicDataSourceFactory] Name = JiraDS Property maxActive is not used in DBCP2, use maxTotal instead. maxTotal default value is 8. You have set value of "350" for "maxActive" property, which is being ignored.
2017-07-11 21:39:03,583 localhost-startStop-1 WARN [tomcat.dbcp.dbcp2.BasicDataSourceFactory] Name = JiraDS Property removeAbandoned is not used in DBCP2, use one or both of removeAbandonedOnBorrow or removeAbandonedOnMaintenance instead. Both have default value set to false. You have set value of "true" for "removeAbandoned" property, which is being ignored.
2017-07-11 21:39:03,583 localhost-startStop-1 WARN [tomcat.dbcp.dbcp2.BasicDataSourceFactory] Name = JiraDS Property maxWait is not used in DBCP2 , use maxWaitMillis instead. maxWaitMillis default value is -1. You have set value of "30000" for "maxWait" property, which is being ignored.
Diagnosis
The database connection is being defined in server.xml
instead of dbconfig.xml
as per recommended in official database connection documentation. This is an unsupported configuration and database connection needs to be to specify in dbconfig.xml
. For example:
<Resource name="jdbc/JiraDS"
auth="Container"
type="javax.sql.DataSource"
username="Sanitized by Support Utility"
password="Sanitized by Support Utility"
driverClassName="oracle.jdbc.OracleDriver"
url="jdbc:oracle:thin:@xxx:1521:xxx"
initialSize="50"
maxIdle="50"
maxWait="30000"
minIdle="50"
maxActive="350"
testOnBorrow="false"
testWhileIdle="true"
validationQuery="select 1 from dual"
minEvictableIdleTimeMillis="60000"
timeBetweenEvictionRunsMillis="300000"
removeAbandoned="true"
removeAbandonedTimeout="300"
JIRA might experience database connection exhaustion; Jira Server or Data Center is slow with dangerous use of multiple connections error in log:
2017-07-11 21:32:10,908 http-nio-8080-exec-316 WARN xxx 1292x1378477x9 1v9vgk1 10.254.180.144 /secure/CommentAssignIssue.jspa [atlassian.jira.ofbiz.ConnectionPoolHealthSqlInterceptor] Dangerous use of multiple connections: taken => count=2; marks=[1-0]; pool=13/8
Cause
The Property name that is being specified in server.xml
has been renamed on Apache 8. Since Apache is not able to interpret the Property, the values will be reverted back to the default ones. For example, let's say maxActive
value is 350, but Apache will revert back to the default value since the new Property name is maxTotal
and it's not being specified. For more information on the Property names, please refer to JNDI Datasource HOW-TO for the valid Property names.
Resolution
Please make sure you are setting up the database connection via dbconfig.xml
. Please avoid using the JNDI connector via server.xml
.