title: Spring Boot 2 disable Autocommit Hikari with multiple datasources
body: <p>I am attempting to turn off auto-commit on Hikari with multiple data sources, but I'm not having any luck. I'm using Spring Boot 2 (2.0.3.RELEASE). Here is my config:</p>
  
  <p>application.properties</p>
  
  <pre><code>spring.datasource.primary.driver=com.mysql.cj.jdbc.Driver
  spring.datasource.primary.url=jdbc:mysql://localhost:3306/spark?autoReconnect=true
  spring.datasource.primary.username=xxxx
  spring.datasource.primary.password=xxxx
  spring.datasource.primary.max-active=100
  spring.datasource.primary.max-idle=5
  spring.datasource.primary.min-idle=1
  spring.datasource.primary.test-while-idle=true
  spring.datasource.primary.test-on-borrow=true
  spring.datasource.primary.validation-query=SELECT 1
  spring.datasource.primary.time-between-eviction-runs-millis=5000
  spring.datasource.primary.min-evictable-idle-time-millis=60000
  
  
  spring.datasource.ucm.driver=com.mysql.cj.jdbc.Driver
  spring.datasource.ucm.url=jdbc:mysql://localhost:3306/usercentral?autoReconnect=true
  spring.datasource.ucm.username=xxx
  spring.datasource.ucm.password=xxx
  spring.datasource.ucm.max-active=100
  spring.datasource.ucm.test-while-idle=true
  spring.datasource.ucm.test-on-borrow=true
  spring.datasource.ucm.validation-query=SELECT 1
  spring.datasource.ucm.time-between-eviction-runs-millis=5000
  spring.datasource.ucm.min-evictable-idle-time-millis=60000
  spring.datasource.ucm.hikari.auto-commit=false  # &lt;- Not working
  </code></pre>
  
  <p>Here's my configuration class where the data sources are setup</p>
  
  <pre><code>@Primary
  @Bean
  @ConfigurationProperties("spring.datasource.primary")
  public DataSourceProperties primaryDataSourceProperties() {
      return new DataSourceProperties();
  }
  
  @Bean
  @Primary
  @ConfigurationProperties("spring.datasource.primary")
  public DataSource primaryDataSource() {
      return primaryDataSourceProperties().initializeDataSourceBuilder().build();
  }
  
  @Bean
  @ConfigurationProperties("spring.datasource.ucm")
  public DataSourceProperties ucmDataSourceProperties() {
      return new DataSourceProperties();
  }
  
  @Bean(name="ucmDataSource")
  @ConfigurationProperties("spring.datasource.ucm")
  public DataSource ucmDataSource() {
      return ucmDataSourceProperties().initializeDataSourceBuilder().build();
  }
  </code></pre>
  
  <p>Here is what is being output when the pool is created:</p>
  
  <pre><code>-2018-08-23 15:48:22.845 -DEBUG 21455 --- [nio-8081-exec-1] com.zaxxer.hikari.HikariConfig           : 1151 : allowPoolSuspension.............false
  -2018-08-23 15:48:22.846 -DEBUG 21455 --- [nio-8081-exec-1] com.zaxxer.hikari.HikariConfig           : 1151 : autoCommit......................true
  -2018-08-23 15:48:22.846 -DEBUG 21455 --- [nio-8081-exec-1] com.zaxxer.hikari.HikariConfig           : 1151 : catalog.........................none
  -2018-08-23 15:48:22.846 -DEBUG 21455 --- [nio-8081-exec-1] com.zaxxer.hikari.HikariConfig           : 1151 : connectionInitSql...............none
  </code></pre>
  
  <p>How do I turn off auto-commit on this connection pool?  </p>