Lovely hack to force db query before disposing