Allow callback to determine if a second persist is needed

As requested in #350

I based this on 2.1 since it doesn't break any current functionality