springboot、PlatformTransactionManagerを使って以下のような
トランザクション処理を行っています。
以下の例文のようにPlatformTransactionManagerを@Autowiredしているため
PlatformTransactionManagerはシングルトンになっています。
@Autowired
private PlatformTransactionManager transactionManager;
メソッド{
TransactionDefinition def = new DefaultTransactionDefinition();
TransactionStatus status = transactionManager.getTransaction(def);
略(SQL実行)
transactionManager.commit(status);
}
この処理を記述している個所は、同時に実行する場合があり
PlatformTransactionManagerのインスタンスを使いまわしていると
もしかすると問題があるのではと危惧しています。
問題があるか?、
問題があれば、どのように対処すべきか知りたいです。
回答1件
あなたの回答
tips
プレビュー
バッドをするには、ログインかつ
こちらの条件を満たす必要があります。
退会済みユーザー
2018/03/01 23:46
2018/03/02 01:47