pass database to lock block as yieldparam