| 1 | = !MapGuide RFC 86 - The Bound FDO Connection = |
| 2 | |
| 3 | This page contains a change request (RFC) for the !MapGuide Open Source project. |
| 4 | More !MapGuide RFCs can be found on the [wiki:MapGuideRfcs RFCs] page. |
| 5 | |
| 6 | == Status == |
| 7 | |
| 8 | ||RFC Template Version||(1.0)|| |
| 9 | ||Submission Date||Sept. 25, 2009|| |
| 10 | ||Last Modified||(Leaf Li) [[Timestamp]]|| |
| 11 | ||Author||(Leaf Li)|| |
| 12 | ||RFC Status||Read for review|| |
| 13 | ||Implementation Status||(pending)|| |
| 14 | ||Proposed Milestone||(2.2)|| |
| 15 | ||Assigned PSC guide(s)||(Tom Fukushima)|| |
| 16 | ||'''Voting History'''||(vote date)|| |
| 17 | ||+1|||| |
| 18 | ||+0|||| |
| 19 | ||-0|||| |
| 20 | ||-1|||| |
| 21 | ||no vote|||| |
| 22 | |
| 23 | == Overview == |
| 24 | |
| 25 | This proposal is to extend MapGuide Feature Service so that calls to Feature Service can use the same FDO connection to avoid some unexpected errors. The solution is to add two methods BindConnection(MgResourceIdentifier featureSourceId) and UnbindConnection(MgResourceIdentifier featureSourceId) so that users are able to bind/unbind an FDO connection to the current user session. |
| 26 | |
| 27 | == Motivation == |
| 28 | |
| 29 | Currently 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. |
| 30 | |
| 31 | |
| 32 | == Proposed Solution == |
| 33 | |
| 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. |
| 35 | |
| 36 | {{{ |
| 37 | /// \brief |
| 38 | /// Bind FDO connection to current session for a feature source. |
| 39 | /// |
| 40 | /// \param featureSourceId (MgResourceIdentifier) |
| 41 | /// A resource identifier referring to a feature source. |
| 42 | /// |
| 43 | /// \return |
| 44 | /// Returns nothing. |
| 45 | /// |
| 46 | void BindConnection(MgResourceIdentifier featureSourceId) = 0; |
| 47 | /// \brief |
| 48 | /// Unbind FDO connection bound to current session for the specified feature |
| 49 | /// source. |
| 50 | /// |
| 51 | /// \param featureSourceId (MgResourceIdentifier) |
| 52 | /// A resource identifier referring to a feature source. |
| 53 | /// |
| 54 | /// \return |
| 55 | /// Returns nothing. |
| 56 | /// |
| 57 | void UnbindConnection(MgResourceIdentifier featureSourceId) = 0; |
| 58 | }}} |
| 59 | |
| 60 | Some of methods in MgFeatureService don’t depend on an existing feature source and an FDO connection. So this change has on effect on them. For example, MgFeatureService::GetFeatureProviders, MgFeatureService::XmlToSchema, and so on. |
| 61 | |
| 62 | == Implications == |
| 63 | |
| 64 | This is new API only. There will be no effect on existing applications. However, API documentation needs to be updated. |
| 65 | |
| 66 | == Test Plan == |
| 67 | |
| 68 | Add unit tests for those new methods into the existing Feature Service unit tests. |
| 69 | |
| 70 | == Funding/Resources == |
| 71 | |
| 72 | Supplied by Autodesk. |