Task doesn't use transaction manager on startup

オープン
#438 コメント 1 件 リアクション 0 件 担当者 1 名 GitHub で見る

まだ誰も着手していません。

評価

この issue はまだ評価されていません。

説明

backport-2.0.x ready type: bug

This could be intended behavior, but when an spring cloud task is starting up, it doesn't use the transaction manager when initializing the execution.

Take as an example spring-cloud-task-samples/multiple-datasources. If we change the secondDataSource to disable autocommit, the application will immediately fail on startup because the creation of the execution will be rolled back immediately. after creating it.

	@Bean
	public DataSource secondDataSource() throws SQLException {
		DataSource ds = new EmbeddedDatabaseBuilder()
				.setType(EmbeddedDatabaseType.H2)
				.build();
		SimpleDriverDataSource sdds = ds.unwrap(SimpleDriverDataSource.class);
		Properties properties = new Properties();
		properties.setProperty("autoCommit", "false");
		sdds.setConnectionProperties(properties);
		return ds;
	}

So either all the initialization code should get wrapped in transaction(s), or the documentation should be updated to reflect that you only support data sources with auto-commit set to true.

主要言語
Java
スター
446
フォーク
310
平均マージ
18時間 18分
マージ済み PR(30日)
6

コントリビューションガイド

コントリビューションガイドを開く

はじめの一歩

  1. issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
  2. 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
  3. リポジトリをフォークし、ブランチを切って変更します。
  4. issue 番号を参照したプルリクエストを送ります。

spring-cloud/spring-cloud-task のほかの issue

spring-cloud/spring-cloud-task の issue をすべて見る

似ている issue

Java の issue をもっと見る

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。