During processing of org.axonframework.eventhandling.EventHandler, events are going to be save in MongoDB 4.0 by spring data repository. But they can’t since since an exception is thrown:
Caused by: com.mongodb.MongoCommandException: Command failed with error 263 (OperationNotSupportedInTransaction): ‘Cannot create namespace axxalon-app-document.documentView in multi-document transaction.’
I guess it’s because Axon is writing to the DB inside a transaction and the db/collection are created once Spring Data is accessing the first time?
May be there is an option in Spring Data that allows creating db/collection at start of the microservice?
Or it’s a restriction of new MongoDB 4.0 feature - https://docs.mongodb.com/manual/core/transactions-operations/#restricted-operations