@Test
public void testHandlesRecursivelyFailingException() throws Exception {

    setUpJdbcLog(false, null);
    // need to register the session since we are going to log errors through LogUtil
    Session.registerSession(new Session(new UnitTestApplication(), new MemoryStoreFactory(),
            sessionID, new DefaultDataDictionaryProvider(), null, logFactory,
            new DefaultMessageFactory(), 0));
    // remove the messages and events tables
    dropTable(log.getIncomingMessagesTableName());
    // now try to log an error
    try {
        log.onIncoming("DB is messed up");
    } catch (OutOfMemoryError err) {
        fail("We seem to get an out of memory error b/c of stack overflow b/c we"
                + "keep calling jdbc logger recursively in case of misconfiguration: "
                + err.getMessage());
    } finally {
        // put the tables back so they can be cleaned up in tearDown()
        initializeTableDefinitions(connection);
    }
}