Array Size Limit Issue
I have used this framework in developing an online job search and recruitment system and number of users are growing day by day. I have now 11336 users in ENTUserAccount table with candidate role. I am now getting out of memory exception when loading long list of users, roles and there capabilities. I came to know that there is Array Size Limit in .net/Dotnet framework. I cannot hold that many users in single array or collection. I think this is not scalable approach.
Following are my findings on Array Size Limit Issue based on data read from Live DB backup:
Users Cached List is a list of 11336 ENTUserAccount objects. Each ENTUserAccount contains ENTRole (1 per user mostly). Each ENTRole contains 30 RoleCapabilities and 11336 RoleUserAccounts. i.e. The list contains 11336 * 1 *(30 + 11336) objects of different types.
Logically, it doesn't seem to be appropriate having RoleUserAccounts in users' list.
As far as the use of Users Cached List is concerned, from most of the locations, application is just reading basic properties of ENTUserAccount e.g. ID and Display Text etc. There are some locations where application uses ENTUserAccount->Roles but ENTUserAccounts->Roles->RoleUserAccounts is never used from the cached list.
As per my knowledge, Role.aspx page is the only location which needs ENTRole->RoleUserAccounts and it doesn't read this data from the cached list rather it fetches the data from database when Role.aspx page is loaded for a role.
We can use some function to load ENTRole->RoleUserAccounts and ENTRole->RoleCapabilities on loading Role.aspx page but I think we should keep ENTRole->RoleUserAccounts and ENTRole->RoleCapabilities empty as there is no point to populate these lists and keep them in cache when these are never used. Just for your notice, Role.aspx page is loading both of the lists from database not from the cache.
I might be wrong so please let me know what are your views on this, please help if you have any suggestion.
Syed Hassan Abbas
Astley bridge, Bolton, UK
Mob: +44 (0) 7761503471