I need clarification on how transactions work. I have read: How to use Transactions http://msdn.microsoft.com/en-us/library/bb243806(v=office.12).aspx. I understand the steps involved but I would like clarification if possible.
I have a routine that updates a master price book entry that changes the old record then creates a new records in succession. After this is completed, I call another routine to propagate those changes to a live price book with manipulation for discounts / pricing tiers etc.
Each function operates without the transaction. I would like to use a transaction to ensure this succeeds or fails as a whole.
If I call a routine from within another routine will the original transaction capture the events in the second routine? If not, I am prepared to incorporate the second routine into the first to guarantee functionality.
This is my first attempt at using transactions. All Tables affected are native to the database.
Example of what I would like to do:
Transaction1
Do stuff
Call propagation routine that affects data related to "do stuff"
Commit Transaction
Thanks in advance.
I have a routine that updates a master price book entry that changes the old record then creates a new records in succession. After this is completed, I call another routine to propagate those changes to a live price book with manipulation for discounts / pricing tiers etc.
Each function operates without the transaction. I would like to use a transaction to ensure this succeeds or fails as a whole.
If I call a routine from within another routine will the original transaction capture the events in the second routine? If not, I am prepared to incorporate the second routine into the first to guarantee functionality.
This is my first attempt at using transactions. All Tables affected are native to the database.
Example of what I would like to do:
Transaction1
Do stuff
Call propagation routine that affects data related to "do stuff"
Commit Transaction
Thanks in advance.