only open data database within appropriate tasks