Hi, On 15.07.19, 07:55, "Richard Groote" <[email protected]> wrote: > 1.Start and stopping application > In our development environment (intellij), our application is started > and stopped frequently. In this scenario the OAK repository is not > gracefully shutdown. When the application is started again, it will take > about 2 minutes to start because ‘waiting for lease to expire’ will > occur. Our current solution is when starting the application to delete > everything in the mongo collection clusterNodes. Are there any drawbacks > for this solution?
Yes, this may cause problems because Oak will then think the repository was shut down properly and not perform the recovery steps on startup. This may result in a broken respository. If you are running tests in an IDE it may be better to use a MemoryDocumentStore instead of a MongoDocumentStore. This ensures the test always starts with a fresh repository. The drawback is, that the test will have to perform any initialization again for you application. Otherwise, ensure the application is stopped gracefully even when starting it in the IDE... > 2.Lease expire messages > When are application is running there are sometimes messages about lease > expired. Currently I’ve used the LeaseCheckMode.DISABLED to disable most > of those messages. Is there some more documentation about lease (I > already read: > https://jackrabbit.apache.org/oak/docs/nodestore/documentmk.html)? Is it > possible to turn this off because we’re not using clustering? Yes, for tests and single repository deployments it's fine to disable the lease check mode, but I still don't recommend it. It would be better to find out why the lease is not updated in time. Potential causes are JVM running out of memory or MongoDB overloaded. You should check those because if the lease cannot be updated for two minutes, there's likely a more widespread performance problem. > 3.Caching > Related to the above, and maybe the reason why this message(s) occur. > The below pseudocode is used. The application logins on the session, > does some action, save and logouts from the session. The dispose, > shutdown, close are not called on the repository/document node store at > the end of every action. The repository should be initialized once when the application is started and then each action should login to get a session, perform the operation and logout. I'm not sure if I understood correctly, but if each action constructs a repository instance, then there's essentially no caching because each read on the repository will have to fetch the data first from MongoDB. Regards Marcel
