Details
Description
I'm able to reproduce the same situation as was in bug 89 initially (http://www.quickfixj.org/jira/browse/QFJ-89)
If you misconfigure the JdbcLog (wrong db name, or just turn off the db altogether), you get into a situation where JdbcLog calls into LogUtil.logThrowable() which tries to lookup the session through Session.lookupSession() which comes back as null and that produces an NPE.
There are actually 2 bugs:
1. When you create a session you try to log session creation.
2. if jdbc log is misconfigured, we get an exception and go into LogUtil.logThrowable() which calls through to Session.lookupSession()
3. since we haven't registered the session yet we get an NPE in LogUtil.logThrowable()
Second bug (this has to do with proxool)
1. When we get the NPE in the above scenario, we try to log it again, which essentially ends up doing this recursively and we run out of memory (see the attached stack trace).
I will create an issue to track the 2nd bug separately as well.
I am submitting a patch that's fixing both bugs:
1. Move the session registration code back from DefaultSessionFactory.create() to the Session() constructor
2. Modify the behaviour of the JdbcLog.insert() to keep track if we are being called recursively and ignore the recursive request in that case. Probably would be a good time to log somewhere else in that case though.