One more place where the db needs to be locked before beginning a transaction