Changes between Version 13 and Version 14 of FDORfc61


Ignore:
Timestamp:
May 26, 2011, 7:30:50 PM (13 years ago)
Author:
samwang
Comment:

--

Legend:

Unmodified
Added
Removed
Modified
  • FDORfc61

    v13 v14  
    88||RFC Template Version||1.1||
    99||Submission Date||May 13, 2011||
    10 ||Last Modified||Sam Wang, May 26, 2011||
     10||Last Modified||Sam Wang, May 27, 2011||
    1111||Author||Sam Wang||
    1212||RFC Status||Draft||
     
    2929== Proposed Solution ==
    3030
    31 Since most FDO data providers which natively support save point mark save points by name, I propose we can add the following interface method to “FdoITransaction” interface.
     31Since most FDO data providers which natively support save point mark save points by name, I propose we can add the following interface method to "FdoITransaction" interface.
    3232{{{
    33 
    34 class FdoSavePoint;
    35 typedef  FdoNamedCollection<FdoSavePoint, FdoException> FdoSavePointCollection;
    3633
    3734class FdoITransaction : public FdoIDisposable
     
    5350    ///
    5451    FDO_API virtual void Rollback(FdoString* savePointName) = 0;
     52......
     53}
     54}}}
     55"!AddSavePoint" method is used to add a save point with a specific name which can later be rolled back to without affecting the work done prior to the save point. "Rollback" method rolls back to a named save point.
    5556
    56     /// \brief
    57     /// Get currently available save points.
    58     ///
    59     /// \return
    60     /// Save point collection.
    61     ///
    62     FDO_API virtual FdoSavePointCollection* GetAvailableSavePoints() = 0;
    63     ......
    64 }
    65 
    66 class FdoSavePoint:  public FdoIDisposable
    67 {
    68      public:
    69         FdoSavePoint( FdoStringP name);
    70         FdoStringP GetName();
    71 
    72         // Indicates that this object does not allow its name
    73         // to change. Not allowing name change allows more efficient
    74         // random access to FdoDictionary.
    75         virtual FdoBoolean CanSetName()
    76         {
    77             return false;
    78         }
    79 
    80     protected:
    81         FdoSavePoint() {}
    82         virtual ~FdoSavePoint() {}
    83         virtual void Dispose();
    84 
    85     private:
    86         FdoStringP mName;
    87 };
    88 }}}
    89 “!AddSavePoint” method is used to add a save point with a specific name which can later be rolled back to without affecting the work done prior to the save point. “Rollback” method rolls back to a named save point. A new class named "!FdoSavePoint" is needed to represent a FDO save point, which contains a name that has to be unique within the current transaction.
    90 
    91 The “FdoIConnectionCapabilities” interface also has to be extended to enable query for this capability:
     57The "FdoIConnectionCapabilities" interface also has to be extended to enable query for this capability:
    9258
    9359{{{
     
    11581try{
    11682......
    117     insertCommand->SetTransaction(transaction)
    11883    FdoIFeatureReader* reader = insertCommand->Execute();
    11984......
     
    12893try{
    12994......
    130     deleteCommand->SetTransaction(transaction)
    13195    int num = deleteCommand->Execute();
    13296......
     
    140104}}}
    141105
    142 Check if a save point is available:
    143 {{{
    144 FdoPtr<FdoITransaction> transaction;
    145 ......
    146 FdoSavePointCollection* savePointCollection = transaction->GetAvailableSavePoints();
    147 if(NULL != savePointCollection->FindItem(L"My_Save_Point"))
    148 {
    149     ......
    150 }
    151 }}}
    152 
    153106== Managed FDO API ==
    154107
     
    157110== Provider Implementation ==
    158111
    159 All providers that natively support save point should return true in FdoIConnectionCapabilities::!SupportsSavePoint and implement new methods in “FdoITransaction” interface to support save point.
     112All providers that natively support save point should return true in FdoIConnectionCapabilities::!SupportsSavePoint and implement new methods in "FdoITransaction" interface to support save point.
    160113
    161114== Test Plan ==