SQL exception
An unhandled exception was generated during the execution of the current web request. Information regarding the origin and location of the exception can be identified using the exception stack trace below. |
|
After some research, I figured that it fails at the following method in my custom RoleProvider
public override string[] GetUsersInRole(string roleName)
This method brings about 1500 users as string[] for a particular role that we have in our existing system. Is the number of users an issue here?
The query in the above error,which i got it from event viewer, is something like...
SELECT a.[id] AS COL1, a.[app_name] AS COL2, a.[commnt] AS COL3, a.[creation_date] AS COL4, a.[email] AS COL5, a
.[fld_psswrd_nswer_attempt_count] AS COL6, a.[fld_psswrd_nswr_ttmpt_wndw_str] AS COL7, a.[failed_password_attempt_count] AS COL8, a.[fld_psswrd_ttempt_window_start] AS COL9,a.[first_name] AS COL10, a.[is_approved] AS COL11, a.[is_backend_user] AS COL12,a.[is_locked_out] AS COL13, a.[is_logged_in] AS COL14, a.[last_activity_date] AS COL15,a.[last_lockout_date] AS COL16, a.[last_login_date] AS COL17, a.[last_login_ip] AS COL18, a.[last_modified] AS COL19, a.[last_name] AS COL20, a.last_password_changed_date] AS COL21,a.[manager_info] AS COL22, a.[passwd] AS COL23, a.[password_answer] AS COL24, a.[password_format] AS COL25, a.password_question] AS COL26, a.[salt] AS COL27, a.[user_name] AS COL28, b.[id] AS COL29, b.[app_name] AS COL30, b.[last_modified] AS COL31, b.[manager_type] AS COL32, b.[provider_name] AS COL33, b.[voa_version] AS COL34 FROM [sf_users] a LEFT JOIN [sf_manager_info] AS b ON (a.[manager_info] = b.[id]) WHERE a.[app_name] = ?
AND (a.[user_name] IN (?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,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,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?.............)
Here is the piece of code that I have:
public override string[] GetUsersInRole(string roleName)
string[] users = new string[0];
try
if (!String.IsNullOrEmpty(roleName))
DataTable roles = ws.GetUsersInRole(htRoles[roleName].ToString()); ( ws is an instance of webservice and this call returns all the Users info for a given role)
users = new string[roles.Rows.Count];
string temp = string.Empty;
int count = 0;
foreach (DataRow row in roles.Rows)
temp = row["CustomerKey"].ToString();//row["LastName"].ToString() + "," + row["FirstName"].ToString();//row[0].ToString();
users[count] = temp;
count++;
catch (Exception ex) writeToLog("Exception:FindUsersInRole:" + ex.Message);
return users;
Currently the website hangs indefinitely. Can someone help me here.
Thanks,
KR
Hi KR,
This is an issue with our Role provider wrapper. It will be fixed in the today's (Friday) internal build.
Best wishes,Since my website hangs with the huge number of users to a particular role, I reduced the number of users for a that role to 2, and I got a different exception as below.
Behavior: While debugging, I was able to login to backend and was able to see Default users, but once I click on the CustomMembershipProvider name in the back end, the website hung.
Also I set breakpoints in every method of the CustomMembershipProvider. The breakpoints were hit only on GetAllUsers and GetUsersInRole(string roleName) methods.
Event code: 3005
Event message: An unhandled exception has occurred.
Event time: 4/28/2011 10:35:12 AM
Event time (UTC): 4/28/2011 2:35:12 PM
Event ID: ff0570694190495897b4161d24d2738c
Event sequence: 3
Event occurrence: 2
Event detail code: 0
Application information:
Application domain: bba96042-7-129484741209826345
Trust level: Full
Application Virtual Path: /
Application Path: C:\Program Files (x86)\Telerik\Sitefinity 4.1\Projects\test41\
Machine name: xxx
Process information:
Process ID: 7676
Process name: WebDev.WebServer40.exe
Exception information:
Exception type: DataStoreException
Exception message: System.NullReferenceException: Object reference not set to an instance of an object.
at Telerik.OpenAccess.RT.Adonet2Generic.Impl.ConnectionImp.commit()
at OpenAccessRuntime.Relational.conn.LoggingConnection.commit()
at OpenAccessRuntime.Relational.conn.PooledConnection.commit()
at OpenAccessRuntime.Relational.RelationalStorageManager.finishRead(StatesReturned container, RelationalCompiledQuery cq, QueryParameters parameters, CachedQueryResult queryData, Int32 queryResultCount)
at OpenAccessRuntime.Relational.RelationalStorageManager.fetchNextQueryResult(ApplicationContext context, RunningQuery runningQuery, Int32 skipAmount)
at Telerik.OpenAccess.SPI.Backends.ThrowException(Exception e)
at Telerik.OpenAccess.RT.ExceptionWrapper.Throw()
at OpenAccessRuntime.storagemanager.logging.LoggingStorageManager.fetchNextQueryResult(ApplicationContext context, RunningQuery runningQuery, Int32 skipAmount)
at OpenAccessRuntime.DataObjects.UnsynchronizedPMProxy.getNextQueryResult(QueryResultWrapper aQrs, Int32 skipAmount)
at OpenAccessRuntime.DataObjects.ForwardQueryResult.Initialize(Int32 indexParam)
at OpenAccessRuntime.DataObjects.ForwardQueryResult.get_Item(Int32 indexParam)
at Telerik.OpenAccess.RT.ListEnumerator.setCurrent(Int32 _pos)
at Telerik.OpenAccess.RT.ListEnumerator.Move(Int32 relative)
at Telerik.OpenAccess.RT.ListEnumerator.MoveNext()
at Telerik.OpenAccess.Query.TypedEnumerator`1.System.Collections.IEnumerator.MoveNext()
at Telerik.Sitefinity.Data.Linq.DataItemEnumerator`1.MoveNext()
at Telerik.Sitefinity.Security.RoleProviderWrapper.GetUserLinks()
at Telerik.Sitefinity.Security.Data.RoleDataProvider.GetRolesForUser(Guid userId)
at Telerik.Sitefinity.Security.SitefinityPrincipal.Initialize()
at Telerik.Sitefinity.Security.SitefinityPrincipal.get_Roles()
at Telerik.Sitefinity.Configuration.RolePolicyHandler.GetPolicyNames(ConfigProvider configProvider, ConfigSection section)
at Telerik.Sitefinity.Configuration.ConfigElement.GetValueFromPolicy(ConfigPolicyHandler handler, ConfigProperty prop, Object& value)
at Telerik.Sitefinity.Configuration.ConfigElement.GetPolicyValue(ConfigProperty prop, Object& value)
at Telerik.Sitefinity.Configuration.ConfigElement.get_Item(ConfigProperty prop, ConfigPolicyHandler policyHandler, String policyName)
at Telerik.Sitefinity.Configuration.ConfigElement.get_Item(ConfigProperty prop)
at Telerik.Sitefinity.Configuration.ConfigElement.get_Item(String propertyName)
at Telerik.Sitefinity.Services.SystemConfig.get_CacheDependencyHandlers()
at Telerik.Sitefinity.Data.CacheDependency..cctor()
Object reference not set to an instance of an object.
at Telerik.OpenAccess.RT.Adonet2Generic.Impl.ConnectionImp.commit()
at OpenAccessRuntime.Relational.conn.LoggingConnection.commit()
at OpenAccessRuntime.Relational.conn.PooledConnection.commit()
at OpenAccessRuntime.Relational.RelationalStorageManager.finishRead(StatesReturned container, RelationalCompiledQuery cq, QueryParameters parameters, CachedQueryResult queryData, Int32 queryResultCount)
at OpenAccessRuntime.Relational.RelationalStorageManager.fetchNextQueryResult(ApplicationContext context, RunningQuery runningQuery, Int32 skipAmount)
Request information:
Request URL: http://localhost:60876/sitefinity/login
Request path: /sitefinity/login
User host address: 127.0.0.1
User: admin
Is authenticated: True
Authentication Type: Sitefinity
Thread information:
Thread ID: 76
Is impersonating: False
Stack trace: at Telerik.OpenAccess.SPI.Backends.ThrowException(Exception e)
at Telerik.OpenAccess.RT.ExceptionWrapper.Throw()
at OpenAccessRuntime.storagemanager.logging.LoggingStorageManager.fetchNextQueryResult(ApplicationContext context, RunningQuery runningQuery, Int32 skipAmount)
at OpenAccessRuntime.DataObjects.UnsynchronizedPMProxy.getNextQueryResult(QueryResultWrapper aQrs, Int32 skipAmount)
at OpenAccessRuntime.DataObjects.ForwardQueryResult.Initialize(Int32 indexParam)
at OpenAccessRuntime.DataObjects.ForwardQueryResult.get_Item(Int32 indexParam)
at Telerik.OpenAccess.RT.ListEnumerator.setCurrent(Int32 _pos)
at Telerik.OpenAccess.RT.ListEnumerator.Move(Int32 relative)
at Telerik.OpenAccess.RT.ListEnumerator.MoveNext()
at Telerik.OpenAccess.Query.TypedEnumerator`1.System.Collections.IEnumerator.MoveNext()
at Telerik.Sitefinity.Data.Linq.DataItemEnumerator`1.MoveNext()
at Telerik.Sitefinity.Security.RoleProviderWrapper.GetUserLinks()
at Telerik.Sitefinity.Security.Data.RoleDataProvider.GetRolesForUser(Guid userId)
at Telerik.Sitefinity.Security.SitefinityPrincipal.Initialize()
at Telerik.Sitefinity.Security.SitefinityPrincipal.get_Roles()
at Telerik.Sitefinity.Configuration.RolePolicyHandler.GetPolicyNames(ConfigProvider configProvider, ConfigSection section)
at Telerik.Sitefinity.Configuration.ConfigElement.GetValueFromPolicy(ConfigPolicyHandler handler, ConfigProperty prop, Object& value)
at Telerik.Sitefinity.Configuration.ConfigElement.GetPolicyValue(ConfigProperty prop, Object& value)
at Telerik.Sitefinity.Configuration.ConfigElement.get_Item(ConfigProperty prop, ConfigPolicyHandler policyHandler, String policyName)
at Telerik.Sitefinity.Configuration.ConfigElement.get_Item(ConfigProperty prop)
at Telerik.Sitefinity.Configuration.ConfigElement.get_Item(String propertyName)
at Telerik.Sitefinity.Services.SystemConfig.get_CacheDependencyHandlers()
at Telerik.Sitefinity.Data.CacheDependency..cctor()
Hi,
I installed the internal build 4.1.1367.0 , but I seem to have no luck. I donot get above mentioned two exceptions, but when I try to go to backend and try to access the users for the Customprovider, the website hangs indefinitely.
Any help here is appreciated.
Thanks.
Hello KR,
Well, how many users do you have in your database? We stress tested with 10,000 users and it was really slow, because the implementation of the ASP.NET membership provider is not perfect. We then tried with 60,000 users and it hung up on us as well. We will investigate on how to improve the performance, but currently when returning a page of users in the users list we need to return ALL users and then select the page that we need.
We also plan on providing external providers compiled in separate .DLL files that will not be burdened with Sitefinity configurations and will be faster.
We have about 40,000 users and 7 roles for external members.
When do you plan to release the fix?
Hello KR,
I'm not sure when this will be possible. The ASP.NET provider itself is not very well optimized. I suppose some fix might be available in the next 2 or 3 weeks.
Regards,