Database Updates fail with 'Can't call commit when autocommit=true'

プラットフォームについて: Data Center のみ。 - This article only applies to Atlassian apps on the Data Center プラットフォーム

この KB は Data Center バージョンの製品用に作成されています。Data Center 固有ではない機能の Data Center KB は、製品のサーバー バージョンでも動作する可能性はありますが、テストは行われていません。 Server* 製品のサポートは 2024 年 2 月 15 日に終了しました。Server 製品を実行している場合は、 アトラシアン Server サポート終了 のお知らせにアクセスして、移行オプションを確認してください。

*Fisheye および Crucible は除く

症状

The following error is thrown in the Bamboo logs, on INSERT's and UPDATE's:

2011-03-10 04:58:16.122019500 2011-03-10 04:58:16,121 ERROR [main] [AbstractUpgradeManager] java.sql.SQLException: Can't call commit when autocommit=true 2011-03-10 04:58:16.122020500 java.sql.SQLException: Can't call commit when autocommit=true 2011-03-10 04:58:16.122021500 at com.mysql.jdbc.SQLError.createSQLException(SQLError.java:931) 2011-03-10 04:58:16.122021500 at com.mysql.jdbc.ConnectionImpl.commit(ConnectionImpl.java:1544) 2011-03-10 04:58:16.122022500 at org.apache.tomcat.dbcp.dbcp.DelegatingConnection.commit(DelegatingConnection.java:301)

または

2017-03-19 06:41:24,742 ERROR [localhost-startStop-1] [AbstractUpgradeManager] org.postgresql.util.PSQLException: Cannot commit when autoCommit is enabled. org.postgresql.util.PSQLException: Cannot commit when autoCommit is enabled. at org.postgresql.jdbc.PgConnection.commit(PgConnection.java:785)

ソリューション

  • Applicable for MySQL only: Add &relaxAutoCommit=true to the end of your JDBC connection string / URL.

例:

jdbc:mysql://localhost/bamdb?autoReconnect=true&relaxAutoCommit=true
  • If using a Tomcat datasource, the equivalent of this is adding the following attribute to your datasource in <bamboo-install>/conf/server.xml: defaultAutoCommit="false"

例:

<Resource name="jdbc/Bamboo" auth="Container" type="javax.sql.DataSource" username="bamboo" password="password" driverClassName="org.postgresql.Driver" url="jdbc:postgresql://localhost:5432/bamboo" maxTotal="100" maxIdle="10" defaultAutoCommit="false" validationQuery="select version();" />
更新日時: September 25, 2025

さらにヘルプが必要ですか?

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