I am not sure why we are always assuming autocommit there. And the error is actually complaining about attempting to set autocommit on a managed Connection. I don't understand how committing a transaction on a managed connection (which shouldn't even be allowed) suddenly lets us call `Connection#setAutocommit(true)`. To me this ought to do something based on the type of ConnectionProvider and the type of TransactionCoordinator and the JDBC metadata (`ExtractedDatabaseMetaData#supportsDataDefinitionInTransaction` and `ExtractedDatabaseMetaData#doesDataDefinitionCauseTransactionCommit` e.g.) |