4 Replies Latest reply: Jan 23, 2012 10:09 AM by Richard Pearce RSS

    General Script Error storing a QVD



      I have a lot of problems with general script errors because all my QVW's that run through the server publish their vital stats to a central LogFile.QVD at the end of their run which I then report on separately.


      I think the problem is that the QVD logFile becomes locked when two or more try QVW's try and perform the Store at the same time. I have tried the sleep command as another post suggests for this error but this didn't resolve the issue. And the same post also says to delete the QVD which I don't think I can do via the script and even if I could I don't think this is the issue.


      I think what I'm looking for is some sort of 'On Error' code which can be switched on just before, if an error is detected (general script error) then it will SLEEP and try again. It will continue to try this for a set number of goes and then Exit Script is it still doesn't have joy.....


      I've looked at the manual but if anyone can give me some pointers that would be great.





        • Re: General Script Error storing a QVD
          Miguel Angel Baeyens de Arce

          Hi Rich,


          There is indeed a variable ScriptError (further documentation on its codes in the Reference Manual) that you can use in an If conditional in your script:


          // Ignore errors and keep executing the next line
          SET ErrorMode = 0; 
          [...] // Script here
          STORE Table INTO File.qvd (qvd); // First attempt
          // If everthing went fine, the following will only iterate 5 taking very few time
          FOR vAttemptNo = 1 TO 5 // Number of attempts
               IF ScriptError = 1 THEN
                    SLEEP 10000; // 10 secs
                    EXIT SCRIPT WHEN $(vAttemptNo) => 5;
                    STORE Table INTO File.qvd (qvd); // another attempt


          I haven't tested the code, so I have missed something.


          Hope that helps.



          • General Script Error storing a QVD
            Stephen Redmond



            Why not have a separate stats QVD for each QVW?


            Easy to concatenate them into a central file for analysis.







              • General Script Error storing a QVD

                Hi Stephen, originally that's how it worked and your right with the * wildcard when loading they'll concat simply..... think I'm a bit OCD really and prefer to remedy the problem and keep a single logfile rather than going back to loads (and I have a lot of QVWs and growing). Cheers for the repsonse though. Rich