G
Guest
In the following try catch block can I guarantee that part b will not execute
if part a throws exception
try {
part a
part b
}
catch (Exception ex) {
do something
}
finally {
dispose of any thing needed
}
I am doing a DB update in part a and an insert in part b based on part a
data. I need to make sure that part a is successful before doing part b.
Part b could be multiple items from a listbox that may or may not be
different then what's already in the table. I could delete all and then
insert these but I have to make sure that part a completed successfully. Then
if part b fails I need to rollback any of the changes.
Thanks
if part a throws exception
try {
part a
part b
}
catch (Exception ex) {
do something
}
finally {
dispose of any thing needed
}
I am doing a DB update in part a and an insert in part b based on part a
data. I need to make sure that part a is successful before doing part b.
Part b could be multiple items from a listbox that may or may not be
different then what's already in the table. I could delete all and then
insert these but I have to make sure that part a completed successfully. Then
if part b fails I need to rollback any of the changes.
Thanks