Documentation for JIRA 5.0. Documentation for other versions of JIRA is available too. 
![]()
データベースサーバがリブートしたり、あるいはネットワーク障害が発生すると、データベースのコネクションプール内の全てのコネクションが切断され ます。通常、この問題を乗り越えるには、JIRA の再起動を行います(JIRA WAR ディストリビューションにおいては、JIRA を実行しているアプリケーションサーバを再起動する必要があります)。
However, the Apache Commons DBCP (DataBase Connection Pool), which is used by JIRA, can validate connections in the connection pool by running a simple SQL query. If a broken connection is detected, a new one is created to replace it.
To do this, you need to specify an optional <validation-query/> element (in the dbconfig.xml file of your JIRA Home Directory), whose content is the query which validates connections in the connection pool. See the following procedure for details.
To ensure JIRA validates connections in the connection pool:
dbconfig.xml file at the root of your JIRA Home Directory.Add the <validation-query/> element with the appropriate validation query for your type of database, as shown in the example below for MySQL. (See Determining the Validation Querybelow for details.)
<?xml version="1.0" encoding="UTF-8"?>
<jira-database-config>
<name>defaultDS</name>
<delegator-name>default</delegator-name>
<database-type>mysql</database-type>
<schema-name></schema-name>
<jdbc-datasource>
<url>jdbc:mysql://dbserver:3306/jiradb?characterEncoding=utf8&useUnicode=true</url>
<driver-class>com.mysql.jdbc.Driver</driver-class>
<username>jiradbuser</username>
<password>mydbpassword</password>
<pool-size>20</pool-size>
<validation-query>select 1</validation-query>
</jdbc-datasource>
</jira-database-config>
dbconfig.xml ファイルを保存します。各データベースの種類におけるバリデーションクエリは、それぞれ若干異なる SQL 構文の条件を有しています。バリデーションクエリは、プールからコネクションが回収される度に実行されるため、可能な限りシンプルなものが臨まれます。
各バリデーションクエリに推奨されるバリデーションクエリを以下に紹介します。:
データベースタイプ | バリデーションクエリ |
|---|---|
MySQL |
|
Microsoft SQL Server |
|
Oracle |
|
PostgreSQL |
|
これで、データベースのコネクションプールにおける全てのコネクションが完全に失われても、JIRA 、あるいは JIRA を実行中のアプリケーションサーバを再起動させる事無くコネクションを回復できます。
パフォーマンス上の留意点: