(file) Return to InstanceIndexFile.cpp CVS log (file) (dir) Up to [Pegasus] / pegasus / src / Pegasus / Repository

Diff for /pegasus/src/Pegasus/Repository/InstanceIndexFile.cpp between version 1.66 and 1.66.8.2

version 1.66, 2008/12/16 18:57:07 version 1.66.8.2, 2013/06/03 22:36:27
Line 951 
Line 951 
     // copied back to the index file.     // copied back to the index file.
     //     //
  
       do
       {
     if (!FileSystem::renameFileNoCase(path, rollbackPath))     if (!FileSystem::renameFileNoCase(path, rollbackPath))
     {     {
         PEG_METHOD_EXIT();              break;
         return false;  
     }     }
  
     if (!FileSystem::copyFile(rollbackPath, path))     if (!FileSystem::copyFile(rollbackPath, path))
     {     {
               break;
           }
   
           PEG_METHOD_EXIT();
           return true;
       }
       while(0);
   
         // Try to restore the initial state         // Try to restore the initial state
         FileSystem::removeFileNoCase(path);      undoBeginTransaction(path);
         FileSystem::renameFileNoCase(rollbackPath, path);  
  
         PEG_METHOD_EXIT();         PEG_METHOD_EXIT();
         return false;         return false;
     }     }
  
   void InstanceIndexFile::undoBeginTransaction(const String& path)
   {
       PEG_METHOD_ENTER(TRC_REPOSITORY,
           "InstanceIndexFile::undoBeginTransaction()");
   
       String rollbackPath = path;
       rollbackPath.append(".rollback");
   
       //
       // Remove the original index file and
       // Rename the rollback file to the original file
       // If the rollback file is present, this function has no effect
       //
       if(FileSystem::existsNoCase(rollbackPath))
       {
           FileSystem::removeFileNoCase(path);
           FileSystem::renameFileNoCase(rollbackPath, path);
       }
   
     PEG_METHOD_EXIT();     PEG_METHOD_EXIT();
     return true;  
 } }
  
 Boolean InstanceIndexFile::rollbackTransaction(const String& path) Boolean InstanceIndexFile::rollbackTransaction(const String& path)


Legend:
Removed from v.1.66  
changed lines
  Added in v.1.66.8.2

No CVS admin address has been configured
Powered by
ViewCVS 0.9.2