Changes between Version 11 and Version 12 of MapGuideRfc78


Ignore:
Timestamp:
07/09/09 23:18:56 (15 years ago)
Author:
klain
Comment:

--

Legend:

Unmodified
Added
Removed
Modified
  • TabularUnified MapGuideRfc78

    v11 v12  
    3030Currently MapGuide Feature Service supports executing a sequence of standard commands within a single transaction through the API illustrated below. The standard commands are delete/update/insert. If you pass in true for useTransaction, the API will start a transaction and commit(or rollback) it at the end. Thus all command execution will reside inside a single transaction.
    3131{{{
    32     virtual MgPropertyCollection* UpdateFeatures( MgResourceIdentifier* resource,
    33                                                   MgFeatureCommandCollection* commands,
    34                                                   bool useTransaction ) = 0;
     32virtual MgPropertyCollection* UpdateFeatures( MgResourceIdentifier* resource,
     33                                              MgFeatureCommandCollection* commands,
     34                                              bool useTransaction ) = 0;
    3535}}}
    3636However, MapGuide Feature Service also provides another two APIs to execute sql statements as illustrated below, where a database transaction will internally be started and committed befor and after the sql statement execution. Here the capability of executing a sequence of sql statements within a single transaction is missing.
    3737{{{
    38     virtual INT32 ExecuteSqlNonQuery( MgResourceIdentifier* resource,
    39                                       CREFSTRING sqlNonSelectStatement ) = 0;
    40     virtual MgSpatialContextReader* GetSpatialContexts( MgResourceIdentifier* resource,
    41                                                         bool bActiveOnly) = 0;
     38virtual INT32 ExecuteSqlNonQuery( MgResourceIdentifier* resource,
     39                                  CREFSTRING sqlNonSelectStatement ) = 0;
     40virtual MgSpatialContextReader* GetSpatialContexts( MgResourceIdentifier* resource,
     41                                                    bool bActiveOnly) = 0;
    4242}}}
    4343This proposal is to extend Feature Service to support executing a sequence of sql statements within a single transaction.
     
    4646
    4747A new class of MgTransaction will be added to represent a transaction to be performed in a data store.
     48{{{
     49/// \brief
     50/// MgTransaction represents a transaction to be performed in a DataStore.
     51/// If the transaction is time out, commit or rollback a transaction will
     52/// result in one exception MgFeatureServiceException thrown.
     53class MgTransaction : public MgGuardDisposable
     54{
     55PUBLISHED_API:
     56    /// \brief
     57    /// Commit the transaction.
     58    ///
     59    virtual void Commit() = 0;
    4860
     61    /// \brief
     62    /// Rollback the transaction.
     63    ///
     64    virtual void Rollback() = 0;
     65
     66    /// \brief
     67    /// Get the identifier of feature source associated with the transaction.
     68    ///
     69    /// \return
     70    /// Returns the identifier of feature source associated with the transaction.
     71    ///
     72    virtual MgResourceIdentifier* GetFeatureSource() = 0;
     73};
     74}}}
    4975== Implications ==
    5076