You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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.
The text was updated successfully, but these errors were encountered:
Based on HikariCPProviderTest.java and your comment, the auto commit flag on the DataSource is correct (true).
MyBatis-Guice does not handle transactions that are outside a @Transactional annotation. In such cases, it is relying on MyBatis code only.
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 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.The text was updated successfully, but these errors were encountered: