After updating our project to dotConnect for Mysql to version 6.5 and generating new model class we started to run to high cpu usage and memory-leak problems (on our website) right after a new build was deployed.
After some experiments we realized that the problem is not in new dotConnect version but in the generated class.
And the only change we found was that you replaced static member mappingSource by a (static) method which creates non-static instance of AttributeMappingSource. So for each new instance of data context a new instance of mapping source is created as well.
Is there any reason why mapping source is not static member by default?
And is it recommended to create own static instance of it and pass it to constructor of datacontext class?
Thanks in advance.
MappingSource - static vs non-static member
-
- Devart Team
- Posts: 1710
- Joined: Thu 03 Dec 2009 10:48
Thank you for your report, we plan to change this behaviour:
- for the models using MappingMode == 'Attribute', a static MappingSource object will be created and passed to the parameterless constructor of [YourDataContext];
- for the models with MappingMode == 'File', no static mapping source will be used by default.
Passing your own static mapping source to the constructor of your DataContext descendant should not cause any problems.
- for the models using MappingMode == 'Attribute', a static MappingSource object will be created and passed to the parameterless constructor of [YourDataContext];
- for the models with MappingMode == 'File', no static mapping source will be used by default.
Passing your own static mapping source to the constructor of your DataContext descendant should not cause any problems.
-
- Devart Team
- Posts: 1710
- Joined: Thu 03 Dec 2009 10:48
We've implemented these changes. They are available in the latest 3.0.14 build of LinqConnect. The new build can be downloaded from
http://www.devart.com/linqconnect/download.html
(the trial and free versions) or from Registered Users' Area (for users with active subscription only).
For the detailed information about the fixes and improvements available in LinqConnect 3.0.14, please refer to
http://www.devart.com/forums/viewtopic.php?t=22548
http://www.devart.com/linqconnect/download.html
(the trial and free versions) or from Registered Users' Area (for users with active subscription only).
For the detailed information about the fixes and improvements available in LinqConnect 3.0.14, please refer to
http://www.devart.com/forums/viewtopic.php?t=22548