That was the point of my example. Making a change to an object in any fashion is scoped only within the transaction. I changed a property on the jay
object
jayBefore.desc = "Hello, World" //update the description
but .desc
property could be any property. For example suppose my PersonClass had a dogList
property which is a List of DogClass
objects. If this is done within the write
jay.dogList.removeAll() //delete all dogs
the dogList
property after that call will contain 0 entries (as long as we are within the write). If the write fails the dogList
will still contain the original dogs. If it completes, it will contain 0 dogs.