views:

397

answers:

2

I have a collection of objects returned from Subsonic and I want to change a value on them and then save them all, but if 1 save fails I don't want the other changes to persist. I was using linq to sql and using SubmitChanges().

Is there something similar in SubSonic? (I am using 2.1)

+1  A: 

You can use a transaction to do this: http://subsonicproject.com/active-record/transactions/

Rob Conery
thanks - can't believe I didn't find that on my own - sorry about that! Is that you hanging 5?
Slee
Wish it was - no it's Joel Tudor :). I was just doing this the other day (hangin 2 though) and was wishing my wife had a camera :)
Rob Conery
As noted below the link you posted is broken. I couldn't find a link to any 3.0 examples.
runxc1 Bret Ferrier
Here's the new linkhttp://subsonicproject.com/docs/3.0_Transactions
Rob Conery
A: 

the link in the original answer is broken :(

I've seen the TransactionScope example in another post. Is TransactionScope the correct answer? I saw something somewhere about "batch updates" using SubSonic. Is "batch updates" different than TransactionScope? If so, is it only supported in 3.0? (I'm still using 2.1).

Thanks.

R.L.