title: Creating bitronix transaction manager in spring-boot
body: <p>I am trying to create the spring-boot transaction manager bean as follows:</p>
  
  <pre><code>@Bean(destroyMethod="shutdown")
  public static TransactionManager bitronixTransactionManager() {
      return TransactionManagerServices.getTransactionManager();
  }
  </code></pre>
  
  <p>However I am getting:</p>
  
  <pre><code>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)
  </code></pre>
  
  <p>I believe this is cause I am calling .getTransactionManager() myself.</p>
  
  <p>However If i do not, how would I create the transaction manager.</p>
  
  <p>The equivalent xml would be: </p>
  
  <pre><code>&lt;bean id="bitronixTransactionManager" class="bitronix.tm.TransactionManagerServices" 
            factory-method="getTransactionManager" destroy-method="shutdown" depends-on="bitronixConfig" /&gt;
  </code></pre>