次のように、Spring-Boot トランザクション マネージャー Bean を作成しようとしています。
@Bean(destroyMethod="shutdown")
public static TransactionManager bitronixTransactionManager() {
return TransactionManagerServices.getTransactionManager();
}
しかし、私は得ています:
java.lang.IllegalStateException: cannot change the configuration while the transaction manager is running
at bitronix.tm.Configuration.checkNotStarted(Configuration.java:699)
at bitronix.tm.Configuration.setServerId(Configuration.java:145)
これは、自分で .getTransactionManager() を呼び出しているためだと思います。
ただし、そうでない場合、トランザクションマネージャーを作成するにはどうすればよいですか。
同等の xml は次のようになります。
<bean id="bitronixTransactionManager" class="bitronix.tm.TransactionManagerServices"
factory-method="getTransactionManager" destroy-method="shutdown" depends-on="bitronixConfig" />