Configuring a database query timeout

お困りですか?

アトラシアン コミュニティをご利用ください。

コミュニティに質問

問題

If database queries are taking too long to perform, and your application is becoming unresponsive, you can configure a timeout for database queries.

原因

There is no default timeout in Confluence.

ソリューション

If you are using PostgreSQL with driver version 8.3 or later Do Not set a query timeout as described below, as it will cause a SEVERE error and prevent Confluence from starting.

You will need to reapply these changes when upgrading Confluence, as the original databaseSubsystemContext.xml file changes from version to version.

To configure a database query timeout, do the following on your test server:

  1. Confluence をシャットダウンします。
  2. Extract databaseSubsystemContext.xml from the confluence-x.x.x.jar that is in confluence/WEB-INF/lib/, and put a copy in confluence/WEB-INF/classes/. See Editing files within .jar archives.
  3. Edit confluence/WEB-INF/classes/databaseSubsystemContext.xml to add the defaultTimeout property to the "transactionManager" bean:

    <bean id="transactionManager" class="org.springframework.orm.hibernate.HibernateTransactionManager">
        <property name="sessionFactory">
            <ref bean="sessionFactory"/>
        </property>
        <property name="defaultTimeout" value="120"/>
    </bean>
    

    タイムアウトは秒単位で測定され、この時間を超過するクエリは強制的に中止されます。場合によっては、これらのエラーが Confluence によりうまく処理されず、Confluence エラーページが表示されることがあります。

  4. Confluence を起動します。

Once the timeout is working properly in your test environment, migrate the configuration change to your production Confluence environment.

Additional Information

最終更新日: 2016 年 2 月 26 日

この内容はお役に立ちましたか?

はい
いいえ
この記事についてのフィードバックを送信する
Powered by Confluence and Scroll Viewport.