| 75 | |
| 76 | Changes to Feature Service |
| 77 | {{{ |
| 78 | /// \brief |
| 79 | /// Provides an abstraction layer for the storage and retrieval |
| 80 | /// of feature data in a technology-independent way. The API |
| 81 | /// lets you determine what storage technologies are available |
| 82 | /// and what capabilities they have. Access to the storage |
| 83 | /// technology is modeled as a connection. For example, you can |
| 84 | /// connect to a file and do simple insertions or connect to a |
| 85 | /// relational database and do transaction-based operations. |
| 86 | class MgFeatureService : public MgService |
| 87 | { |
| 88 | PUBLISHED_API: |
| 89 | /// \brief |
| 90 | /// Begins a transaction and return it. |
| 91 | /// |
| 92 | /// \param resource (MgResourceIdentifier) |
| 93 | /// A resource identifier referring to a feature source. |
| 94 | /// |
| 95 | /// \return |
| 96 | /// Returns an MgTransaction instance. |
| 97 | /// |
| 98 | virtual MgTransaction* BeginTransaction(MgResourceIdentifier* resource) = 0; |
| 99 | }; |
| 100 | }}} |
| 101 | |
| 102 | One example using the new API |
| 103 | {{{ |
| 104 | MgTransaction tran = AcMapFeatureService::StartTransaction(resourceId); |
| 105 | AcMapFeatureService::ExecuteSql(resourceId, sql statement1); |
| 106 | AcMapFeatureService::ExecuteSql(resourceId, sql statement2); |
| 107 | AcMapFeatureService::UpdateFeatures(resourceId, standard commands, false); // NOTE: you have to pass in false for useTransaction here. |
| 108 | tran->Commit() // or tran->Rollback(); |
| 109 | }}} |
| 110 | |
| 111 | |