add dbinstace and memory barriar marco