• If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

Announcement

Collapse
No announcement yet.

change to VVOUT data structure

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • change to VVOUT data structure


  • #2
    Yes, "useCacheIfExists" was removed for the final version as we determined that it did not serve much purpose.

    "useCacheIfExists" was checked within the vvOut module but at that point your program would have already gone through the processing of building up the data...thus not taking the advantage of sending back a cached response.

    All of the cache related fields have not been documented within vvOut as this feature has not been "officially" introduced however is in a workable state.

    The method for using the cache is as follows:

    Code:
    if not vvUtility_sendCache('YOURCACHEKEY');
       // process your data...
       //
       vvOut.cache = 'Y';
       vvOut.cacheKey = 'YOURCACHEKEY';
       vvOut.cacheExpire = %timestamp() + %days(30);  // or however long
       vvOut_execSqlToJson(vvOut:stmt);
    endif;
    If you are going to be making use of the cache procedures I want to point out a bug that has been discovered. One new line of code is required within module vvUtility (procedure vvUtility_sendCache). The new line is highlighted in red.
    Code:
    ** --------------------------------------------------------------     
    p vvUtility_sendCache...                                              
    p                 b                   export                          
    d                 pi              n                                   
    d  inKey                        30a   const varying options(*varsize) 
                                                                          
     /free                                                                
      if not %open(vvche100);                                             
        open vvche100;                                                    
      endif;                                                              
      chain (inKey) vvche100;                                             
      if not %found(vvche100);                                            
        return FALSE;                                                     
       else;                                                              
        // ensure that this is not expired...                             
        //                                                                
        if %timestamp() > vvexpire;                                       
          delete che100;                                                  
          reade (inKey) vvche100;                                         
          dow not %eof(vvche100);                                         
            delete che100;                                                
            reade (inKey) vvche100;                                       
          enddo;                                                          
          return FALSE;        
         else;                            
          unlock vvche100;                
          vvOut_data(vvdata:vvtype);      
          reade(n) (inKey) vvche100;      
          dow not %eof(vvche100);         
            vvOut_data(vvdata);           
            reade(n) (inKey) vvche100;    
          enddo;                          
        endif;                            
      endif;                              
      return TRUE;                        
     /end-free                            
    p                 e

    Comment


    • #3
      Sean,
      Thanks for your reply. My concern is that any changes to data structures used by user programs be documented or at the very least an advice to recompile programs be issued whenever such changes are implemented in new releases. Like that we know what to expect and can be proactive when we upgrade.
      -thanks,
      Hugo.

      Comment


      • #4
        Hi Hugo,

        I understand your concern. Our process of adding new fields to the structures have always been to add to the bottom and then subtract from the "fill". This was the first case (and should be the last) of ever removing a field. We only felt comfortable making this change because it was only released in a beta version. Sorry for the confusion...if this is ever the case again, we will be sure to include instructions in the release notes.

        Comment

        Working...
        X