sepatel / inigma-shared

This project is no longer maintained. Common Libraries used for Web Applications
Apache License 2.0
3 stars 0 forks source link

Timer Thread dies if mongo closes during reload #1

Closed sepatel closed 12 years ago

sepatel commented 12 years ago

Stack trace of relevance.

Exception in thread "Timer-1" java.lang.IllegalStateException: this Mongo has been closed
org.inigma.shared.config.MongoConfiguration.reload(MongoConfiguration.java:123)
org.inigma.shared.config.MongoConfiguration.access$000(MongoConfiguration.java:31)
org.inigma.shared.config.MongoConfiguration$1.run(MongoConfiguration.java:59)
sepatel commented 12 years ago

Added a try/catch to trap the exception instead of allowing it to escalate up and terminate the timer task. It is also being logged properly as well and some enterprise level usage will tell better if the Mongo driver in all cases (or at least in many cases) will auto-recover a closed connection on its own or not to see if this is a sufficient solution.