It appears that auto commit is false when you are executing a mapper statement in a method NOT decorated with @Transactional annotation. I verified this by sticking a breakpoint on JdbcTransactionFactory.newTransaction(DataSource ds, TransactionIsolationLevel level, boolean autoCommit) (My default data source auto commit value is set to true. I am using Hikari CP). Is this the expected behaviour? If so, it would be nice if there was some config in the MyBatisModule to allow you to set the default auto commit value for all query behaviour not wrapped within the transactional annotation.
It appears that auto commit is false when you are executing a mapper statement in a method NOT decorated with
@Transactionalannotation. I verified this by sticking a breakpoint onJdbcTransactionFactory.newTransaction(DataSource ds, TransactionIsolationLevel level, boolean autoCommit)(My default data source auto commit value is set to true. I am using Hikari CP). Is this the expected behaviour? If so, it would be nice if there was some config in the MyBatisModule to allow you to set the default auto commit value for all query behaviour not wrapped within the transactional annotation.