Lazy start mongodb datastore provider

MongoDBDatastoreProvider class can be enhanced to lazy start so that any dependent application (e.g. war, SpringBoot, etc…) could properly start without requiring a database connection. This can be made configurable by a hibernate.ogm.mongodb.something property in MongoDBProperties class. This would be helpful for example in a microservice architecture where the services (including mongodb) could start in an undefined random order or to deploy and test some scenarios not requiring the mongodb service.
p.s. I have already implemented something working.

Sounds interesting. If you send a PR or share a link I can have a look of what you have already done.


I could try a PR but for that I would need an OGM issue I’m thinking.
I did the changes on the 5.3.1.Final branch since this is the version I was using. It would help me to have it there and maybe release a 5.3.2 version because I cannot currently go with a newer version.

If you send a PR with [PREVIEW] in the title on the branch you prefer I can start to have a look at it and have an idea of the changes we need. It’s OK if it’s not bound to an issue for now, I can create one later.

PR opened, see