Changes between Version 27 and Version 28 of MapGuideRfc78


Ignore:
Timestamp:
Jul 16, 2009, 7:30:47 PM (15 years ago)
Author:
klain
Comment:

--

Legend:

Unmodified
Added
Removed
Modified
  • MapGuideRfc78

    v27 v28  
    4141                                  CREFSTRING sqlNonSelectStatement ) = 0;
    4242}}}
    43 This proposal is to extend Feature Service to support executing a sequence of sql statements within a single transaction.
     43This proposal is to expose a seperate transaction control from Feature Service to enable executing a sequence of sql statements within a single transaction.
    4444
    4545== Proposed Solution ==
    4646
    47 A new class of !MgTransaction will be added to represent a transaction to be performed in a data store.
     47A new class of MgTransaction will be added to represent a transaction to be performed in a data store.
    4848{{{
    4949/// \brief
     
    7676Changes to Feature Service
    7777
    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.
     78ExecuteSqlQuery() 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
    8080{{{
     
    113113One example using the new API
    114114{{{
    115 MgTransaction* tran = AcMapFeatureService::StartTransaction(resourceId);
    116 AcMapFeatureService::ExecuteSql(resourceId, sql statement1, tran);
    117 AcMapFeatureService::ExecuteSql(resourceId, sql statement2, tran);
     115MgTransaction* tran = MgFeatureService::StartTransaction(resourceId);
     116MgFeatureService::ExecuteSql(resourceId, sql statement1, tran);
     117MgFeatureService::ExecuteSql(resourceId, sql statement2, tran);
    118118tran->Commit() // or tran->Rollback();
    119119}}}
    120120
    121 Timeout configuration for !MgTransaction
     121Timeout configuration for MgTransaction
    122122
    123 If an !MgTransaction has been started but hasn't been committed or rollbacked within the timeout, the transaction will be automatically rollbacked. If you call Commit() or Rollback() after timeout, an exception will be thrown reminding that the transaction has been timeout.
     123As the transaction is a critical resource for database applications, a server-side transaction can be left open while the application is doing other things in between sql or even worse the application may fail or hang and the server would not know. So it needs to set a timeout for all transactions. If a transaction hasn't been committed or rollbacked within the timeout, the server will automatically rollback the transaction. If you call Commit() or Rollback() on the MgTransaction instance after timeout, an exception will be thrown reminding that the transaction has been timeout and reverted.
    124124
    125 Two items will be added into serverconfig.ini for transaction timeout setting. If the transaction hasn't been committed or rollbacked within thirty minutes, it will be automatically rollbacked.
     125Two items will be added into serverconfig.ini for transaction timeout setting. If the transaction hasn't been committed or rollbacked within 2 minutes, it will be automatically rollbacked.
    126126{{{
    127127DataTransactionTimeout             = 120