>If I drop two business objects on a form, object 'Father' and object 'Son'.
>Then in the Son object, I set it's parent object property to Father, and check it's "New child on new parent" and "Save child on save parent" properties.
>What is the proper way to wrap the saves of these objects into one transaction?
>The way I currently have it, the Father can save with the Son failing.
>
>And if it makes any difference, these are remote views.
>
>Thanks,
>Anthony Letts
That's a tough question. In MM, transactions are supported for local data only. The fact that you are using remote views makes it even trickier. There are no settings in the BO to handle this. That does not mean it can't be done, however.
What you will need to do is bind each of the view connections together through SQLPassthrough and wrap them in a sql server transaction. Once bound, it doesn't matter which connection initiates the transaction. A simpler method would be to have each view share the same connection and wrap everything in a sqltransaction.
=SQLSetProp(lnHandle, "Transactions", 2)
There is a good discussion on these techniques in "Client/Server Applications with Visual Foxpro and SQL Server", available at
www.hentzenwerke.com. Recoding the save method in kBizobj would not be that difficult, but I would wait to see what's in the upcoming version.