Errors Using Axon with MySQL Where GTID is Enabled

We are trying to use Axon in Pivotal Cloud Foundry using their MySQL service broker, which appears to turn on GTID by default. With that enabled, I’m getting errors in the logs:

“Statement violates GTID consistency: Updates to non-transactional tables can only be done in either autocommitted statements or single-statement transactions, and never in the same statement as updates to transactional tables.”

I don’t know exactly what SQL statement it’s trying to execute at the time, but these happen on the EventProcessor thread. Is there some way to change the default behavior of Axon so that it executes queries in a way that MySQL isn’t going to be grumpy about it? I am using the Spring Boot autoconfiguration support for Axon on Spring Boot 2.1.4.RELEASE.

Thanks,

James

I think I may have figured it out. There were some tables created as
MyISAM and some on InnoDB. That mixture seems to be what was causing
the fits with GTID.

Hi James,

glad you found it, already. You’re most likely using the Spring Boot Starter for Axon. In that case, Axon will configure a transaction manager that will wrap your command handling and event processing (in tracking processors) in a (database) transaction. So in this case you’re “lucky” that you were notified of the fact that some tables aren’t capable of participating in this transaction.

Cheers,