sample() needs an explicit transaction.