Add error logging to checkContext() in DataBase implementation