Changes between Version 33 and Version 34 of MapGuideRfc78


Ignore:
Timestamp:
Jul 23, 2009, 11:54:09 PM (15 years ago)
Author:
klain
Comment:

--

Legend:

Unmodified
Added
Removed
Modified
  • MapGuideRfc78

    v33 v34  
    7878ExecuteSqlQuery() and ExecuteSqlNonQuery() must use the same underlying connection on which the transaction started. So MgTransaction instance is passed in as parameters for both of these two methods. The MgTransaction implementation can return the undelying connection.
    7979
     80The existing UpdateFeatures function will execute the standard commands in some other connection from the connection pool. If passing in true for useTransaction, it will use a different transaction other than the one started by BeginTransaction().
     81
     82So in order to be consistent with UpdateFeatures function, an overloaded version of UpdateFeatures function will be added taking a transaction object as well. It executes the standard commands within the same transaction explicityly started by BeginTransaction(). However this needs to be documented clearly to the users that if they are using the new APIs with the transaction object, they should stick to that and not mix in the old UpdateFeatures() API.
     83
    8084{{{
    8185/// \brief
     
    108112                                  CREFSTRING sqlNonSelectStatement,
    109113                                  MgTransaction* transaction) = 0;
     114
     115MgPropertyCollection* MgServerFeatureService::UpdateFeatures( MgResourceIdentifier* resource,
     116                                                              MgFeatureCommandCollection* commands,
     117                                                              MgTransaction* tran );
     118
    110119};
    111120}}}
     
    119128    MgFeatureService.ExecuteSql(resourceId, sql statement1, tran);
    120129    MgFeatureService.ExecuteSql(resourceId, sql statement2, tran);
     130    MgFeatureService.UpdateFeatures(resourceId, MgFeatureCommandCollection, tran);
    121131    tran.Commit();
    122132}
     
    131141a. If any exception is thrown within the sql statement execution, the new API won't rollback the transaction internally. Instead, it depends on the client application to rollback the transaction explicitly as illustrated in above codes.
    132142b. If a provider doesn't support transaction, BeginTransaction() will throw an MgInvalidOperationException saying transaction is not supported.
    133 c. If passing in NULL for the parameter, ExecuteSqlQuery and ExecuteSqlNonQuery will work the same as before taking no transaction is started.
     143c. If passing in NULL for the parameter, ExecuteSqlQuery and ExecuteSqlNonQuery will work the same as before taking no transaction is started. For new version of UpdateFeatures function, it will work the same as you pass in false for useTransaction.
    134144
    135145Timeout configuration for MgTransaction
     
    152162This new API is designed for sql statement execution. You have to use the API with !ExecuteSqlQuery() or !ExecuteSqlNonQuery() within the transaction.
    153163
     164If the user uses the new UpdateFeatures function taking the transaction object, they should stick to that and not mix in the old UpdateFeatures() API.
     165
    154166== Test Plan ==
    155167