Why does the DB lock tables