use a mutex _and_ set a boolean flag on the DB
require DB to be initialised before running script