This API is still somewhat unsafe in that it doesn't inhibit nested transactions, but it's better than it was.