CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 3 of 3

Threaded View

  1. #1
    Join Date
    Jul 2007
    Posts
    38

    Post handling exception

    Hi Guys,
    I have bumped into an issue today, as I wanted to make my process better in Fault Tolerance(FT)
    I have a tray block trying to execute some sqls, and if any exception is thrown (due to an issue in the DB side), I want to hang for a while and retry the same execution, rather give an error warning and forget. bcoz the later will cause some data not stored to DB properly. If the exception is due to a disconnection, I'll have to retry to connect for ever. (This window can be used to fix the DB issues, and imediately my program should move forward).

    I'm thinking of the following structure. but not sure this is a good practice. can any one please help?
    Code:
    while(true)
      try{
         handle.execute("INSERT.....");
         break;
      }
      catch(Exception::Connect& e){
          sleep(10);
          reconnect();
      }
      catch(Exception::Execute& e) {
         sleep(10);
      }
    }
    Last edited by skanthaverl; April 16th, 2008 at 08:34 AM.
    Regards
    sris kanagasabai

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  





Click Here to Expand Forum to Full Width

Featured