Changes between Version 13 and Version 14 of FDORfc61
- Timestamp:
- 05/26/11 19:30:50 (14 years ago)
Legend:
- Unmodified
- Added
- Removed
- Modified
-
FDORfc61
v13 v14 8 8 ||RFC Template Version||1.1|| 9 9 ||Submission Date||May 13, 2011|| 10 ||Last Modified||Sam Wang, May 2 6, 2011||10 ||Last Modified||Sam Wang, May 27, 2011|| 11 11 ||Author||Sam Wang|| 12 12 ||RFC Status||Draft|| … … 29 29 == Proposed Solution == 30 30 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.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. 32 32 {{{ 33 34 class FdoSavePoint;35 typedef FdoNamedCollection<FdoSavePoint, FdoException> FdoSavePointCollection;36 33 37 34 class FdoITransaction : public FdoIDisposable … … 53 50 /// 54 51 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. 55 56 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: 57 The "FdoIConnectionCapabilities" interface also has to be extended to enable query for this capability: 92 58 93 59 {{{ … … 115 81 try{ 116 82 ...... 117 insertCommand->SetTransaction(transaction)118 83 FdoIFeatureReader* reader = insertCommand->Execute(); 119 84 ...... … … 128 93 try{ 129 94 ...... 130 deleteCommand->SetTransaction(transaction)131 95 int num = deleteCommand->Execute(); 132 96 ...... … … 140 104 }}} 141 105 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 153 106 == Managed FDO API == 154 107 … … 157 110 == Provider Implementation == 158 111 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.112 All providers that natively support save point should return true in FdoIConnectionCapabilities::!SupportsSavePoint and implement new methods in "FdoITransaction" interface to support save point. 160 113 161 114 == Test Plan ==