none
Timeout on SqlMembershipProvider RRS feed

  • Question

  • Hello,


    Under heavy load, I get a timeout on the UpdateUser methode found in SqlMembershipProvider.  It works perfectly until there's a load on the server.


    System.Data.SqlClient.SqlException: Timeout expired. The timeout period elapsed prior to completion of the operation or the server is not responding. at System.Data.SqlClient.SqlConnection.OnError(SqlException exception, Boolean breakConnection) at System.Data.SqlClient.SqlInternalConnection.OnError(SqlException exception, Boolean breakConnection) at System.Data.SqlClient.TdsParser.ThrowExceptionAndWarning(TdsParserStateObject stateObj) at System.Data.SqlClient.TdsParser.Run(RunBehavior runBehavior, SqlCommand cmdHandler, SqlDataReader dataStream, BulkCopySimpleResultSet bulkCopyHandler, TdsParserStateObject stateObj) at System.Data.SqlClient.SqlCommand.FinishExecuteReader(SqlDataReader ds, RunBehavior runBehavior, String resetOptionsString) at System.Data.SqlClient.SqlCommand.RunExecuteReaderTds(CommandBehavior cmdBehavior, RunBehavior runBehavior, Boolean returnStream, Boolean async) at System.Data.SqlClient.SqlCommand.RunExecuteReader(CommandBehavior cmdBehavior, RunBehavior runBehavior, Boolean returnStream, String method, DbAsyncResult result) at System.Data.SqlClient.SqlCommand.InternalExecuteNonQuery(DbAsyncResult result, String methodName, Boolean sendToPipe) at System.Data.SqlClient.SqlCommand.ExecuteNonQuery() at System.Web.Security.SqlMembershipProvider.UpdateUser(MembershipUser user)


     As far as I know this method is maintained by dotnet itself.  Is there any way I can minimise this ?



    I just call the method update user from membership. That's all.


    Eg :


    MembershipUser membershipUser = SecurityManager.GetCurrentUser();

     

    membershipUser.IsApproved = false;

    SecurityManager.UpdateUser(membershipUser);

     

    The method UpdateUser in my SecurityManager Class :

     

    public static void UpdateUser(MembershipUser user)

    {

    using (TransactionScope scope = new TransactionScope(TransactionScopeOption.Suppress))

    {

    Membership.UpdateUser(user);

    }

    }

    Friday, March 21, 2008 3:35 PM

Answers