/** * Ensure an <code>autoCommit</code> value on the connection, if it was set * to <code>true</code>, originally. */ private final void brace(Configuration configuration, boolean start) { DefaultConnectionProvider connection = connection(configuration); try { boolean autoCommit = autoCommit(configuration); // Transactions cannot run with autoCommit = true. Change the value for // the duration of a transaction if (autoCommit == true) connection.setAutoCommit(!start); } // [#3718] Chances are that the above JDBC interactions throw additional exceptions // try-finally will ensure that the ConnectionProvider.release() call is made finally { if (!start) { connectionProvider.release(connection.connection); configuration.data().remove(DATA_DEFAULT_TRANSACTION_PROVIDER_CONNECTION); } } }