Changes between Version 33 and Version 34 of MapGuideRfc78
- Timestamp:
- 07/23/09 23:54:09 (16 years ago)
Legend:
- Unmodified
- Added
- Removed
- Modified
-
MapGuideRfc78
v33 v34 78 78 ExecuteSqlQuery() 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. 79 79 80 The 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 82 So 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 80 84 {{{ 81 85 /// \brief … … 108 112 CREFSTRING sqlNonSelectStatement, 109 113 MgTransaction* transaction) = 0; 114 115 MgPropertyCollection* MgServerFeatureService::UpdateFeatures( MgResourceIdentifier* resource, 116 MgFeatureCommandCollection* commands, 117 MgTransaction* tran ); 118 110 119 }; 111 120 }}} … … 119 128 MgFeatureService.ExecuteSql(resourceId, sql statement1, tran); 120 129 MgFeatureService.ExecuteSql(resourceId, sql statement2, tran); 130 MgFeatureService.UpdateFeatures(resourceId, MgFeatureCommandCollection, tran); 121 131 tran.Commit(); 122 132 } … … 131 141 a. 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. 132 142 b. 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. 143 c. 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. 134 144 135 145 Timeout configuration for MgTransaction … … 152 162 This new API is designed for sql statement execution. You have to use the API with !ExecuteSqlQuery() or !ExecuteSqlNonQuery() within the transaction. 153 163 164 If 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 154 166 == Test Plan == 155 167