wrap queue update code in a transaction