Changes between Version 9 and Version 10 of MapGuideRfc86


Ignore:
Timestamp:
09/24/09 19:47:14 (15 years ago)
Author:
leaf
Comment:

--

Legend:

Unmodified
Added
Removed
Modified
  • MapGuideRfc86

    v9 v10  
    2929Currently MapGuide Server maintains an FDO connection pool in order to improve performance. Once MapGuide Server receives a request to access data in a feature source, it will try to find an available FDO connection in FDO connection pool. It avoids exhausting FDO connections to the underlying RDBMS and improves performance of MapGuide Server when many users use MapGuide Server in the same time. However, it means that one user session may use the different FDO connection for the same feature source at the different time. Sometimes, it will result in some unexpected errors. Let’s take a look at one example.
    3030
     31{{{
     32    MgSqlDataReader reader1 = featureService.ExecuteSqlQuery(featureSourceId, commandText, mgParameters, null);
     33    while (reader1.ReadNext())
     34    {
     35        MgSqlDataReader reader2 = featureService.ExecuteSqlQuery(featureSourceId, commandText, mgParameters, null);
     36        while (reader2.ReadNext())
     37        {
     38            ......
     39        }
     40        reader2.Close();
     41        reader.Dispose();
     42    }
     43    reader1.Close();
     44    reader1.Dispose();
     45}}}
    3146
    3247== Proposed Solution ==
    3348
    34 In this RFC, we extend Feature Service to add the ability to use the same FDO connection for calls to Feature Service. The following two methods will be added to class !MgFeatureService to allow users to bind/unbind an FDO connection to the current session. Method !BindConnection(...) will select an FDO connection from FDO connection pool for the specified feature source if there is one FDO connection available. Otherwise, create a new FDO connection and add it to FDO connection pool. Then this FDO connection is bound to current session. It means this FDO connection becomes an exclusive connection and can’t be used by other sessions. Since then, any call to Feature Service for the feature source and the session, which needs an FDO connection, will always use the bound FDO connection till users call method !UnbindConnection(...) to unbind this FDO connection or current session is time-out. By default, one session will be time-out after 20 minutes. Users can modify this setting through property[!SiteServiceProperties]->!SessionTimeOut in MapGuide Server configuration file "serverconfig.ini".
     49In this RFC, we extend Feature Service to add the ability to use the same FDO connection for calls to Feature Service. The following two methods will be added to class !MgFeatureService to allow users to bind/unbind an FDO connection to the current session. Method !BindConnection(...) will select an FDO connection from FDO connection pool for the specified feature source if there is one FDO connection available. Otherwise, create a new FDO connection and add it to FDO connection pool. Then this FDO connection is bound to current session. It means this FDO connection becomes an exclusive connection and can’t be used by other sessions. Since then, any call to Feature Service for the feature source and the session, which needs an FDO connection, will always use the bound FDO connection till users call method !UnbindConnection(...) to unbind this FDO connection or current session is time-out. By default, one session will be time-out after 20 minutes. Users can modify this setting through property [!SiteServiceProperties]->!SessionTimeOut in MapGuide Server configuration file "serverconfig.ini".
    3550
    3651{{{