Changes between Version 2 and Version 3 of FDORfc61


Ignore:
Timestamp:
May 12, 2011, 11:31:18 PM (13 years ago)
Author:
samwang
Comment:

--

Legend:

Unmodified
Added
Removed
Modified
  • FDORfc61

    v2 v3  
    1 = FDO RFC 60 - Extend FDO API to add support for save point =
     1= FDO RFC 60 - Extend FDO transaction API to support save point =
    22
    33This page contains a request for comments document (RFC) for the FDO Open Source project. 
     
    2121 
    2222== Overview ==
    23 
     23This RFC proposes an extended FDO transaction capability to support save point.
    2424
    2525
    2626== Motivation ==
    27 
     27FDO currently does not support starting another transaction (i.e. a sub transaction) inside a transaction that has already been started, or divide a transaction into smaller parts that can be independently submit or rolled back. The consequence of this is that for a complicated transaction (may be time consuming), the overall effort will be rolled back if a little error occurs at some point. Thus we need to extend the FDO transaction API to support save point. The purpose of this RFC is to provide a solution for such extension.
    2828
    2929== Proposed Solution ==
    3030
     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.
     32{{{
     33class FdoITransaction : public FdoIDisposable
     34{
     35    ......
     36    /// \brief
     37    ///  Creates a save point in this transaction.
     38    ///
     39    /// \param savePointName
     40    /// Save point name.
     41    ///
     42    FDO_API virtual void AddSavePoint(FdoString* savePointName) = 0;
     43
     44    /// \brief
     45    ///  Rollbacks the transaction to the specified save point.
     46    ///
     47    /// \param savePointName
     48    /// Save point name.
     49    ///
     50    FDO_API virtual void Rollback(FdoString* savePointName) = 0;
     51    ......
     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. 
     56
     57The “FdoIConnectionCapabilities” interface also has to be extended to enable query for this capability:
     58
     59{{{
     60class FdoIConnectionCapabilities : public FdoIDisposable
     61{
     62    ......
     63    /// \brief
     64    /// Returns the current transaction of the connection.
     65    ///
     66    /// \return
     67    /// Returns the current transaction, NULL if no active transaction exists.
     68    ///
     69    FDO_API virtual bool SupportsSavePoint() = 0;
     70    ......
     71}
     72}}}
    3173
    3274
    33 == Implications ==
     75== Managed FDO API ==
    3476
    35 TBD
     77The FDO Managed Interfaces will be updated in a similar manner to reflect the proposed changes.
     78
     79== Provider Implementation ==
     80
     81All providers that natively support save point should return true in FdoIConnectionCapabilities::SupportsSavePoint and implement new methods in “FdoITransaction” interface to support save point.
    3682
    3783== Test Plan ==
    3884
    39 TBD
     85Existing FDO core unit tests will be expanded to test the proposed enhancements defined above.
     86Provider specific unit tests will be added to test the proposed enhancements defined above.
    4087
    4188== !Funding/Resources ==
    4289
    43 TBD
     90Autodesk to provide funding/resources.
    4491