The following is pseudocode:
myGoto:
try
{
// do some db updating
myDB.doOptimisticConcurrency();
} catch (MyConcExeption ex) {
if (tried < fiveTimes) {
myDB.Refresh();
tried++;
goto myGoto;
}
}
I have several try-catch blocks in one method, and I don't want to reinvoke my method from the beginning for every thrown exception. Is using goto
acceptable in this situation?