Bug #6

Npgsql throws InvalidOperationException saying "Connection is not open" when called from UpdateFailureCount()

Added by Christoffer Timm over 3 years ago. Updated over 3 years ago.

Status:Closed Start:
Priority:High Due date:
Assigned to:Daniel Nauck % Done:

0%

Category:Membership Spent time: -
Target version:1.2.1

Description

When ResetPassword(string username, string answer) in Membership component is called with a answer not matching the user's answer as saved in database, UpdateFailureCount(username, FailureType.PasswordAnswer) (line 1054) is called which in turn calls methods of Npgsql.

Npgsql.NpgsqlCommand.CheckConnectionState() finally throws an InvalidOperationException saying "Connection is not open".

StackTrace:

Die Verbindung ist nicht offen.
* bei Npgsql.NpgsqlCommand.CheckConnectionState()
* bei Npgsql.NpgsqlCommand.GetReader(CommandBehavior cb)
* bei Npgsql.NpgsqlCommand.ExecuteNonQuery()
* bei NauckIT.PostgreSQLProvider.PgMembershipProvider.UpdateFailureCount(String username, FailureType failType)
* bei NauckIT.PostgreSQLProvider.PgMembershipProvider.ResetPassword(String username, String answer)
* bei PasswordRecovery.VerifyAnswer(Object sender, EventArgs e) in d:\Websites\TradeState.eu\PasswordRecovery.aspx.cs:Zeile 29.
* bei System.Web.UI.WebControls.PasswordRecovery.OnVerifyingAnswer(LoginCancelEventArgs e)
* bei System.Web.UI.WebControls.PasswordRecovery.AttemptSendPasswordQuestionView()
* bei System.Web.UI.WebControls.PasswordRecovery.AttemptSendPassword()
* bei System.Web.UI.WebControls.PasswordRecovery.OnBubbleEvent(Object source, EventArgs e)
* bei System.Web.UI.Control.RaiseBubbleEvent(Object source, EventArgs args)
* bei System.Web.UI.WebControls.Button.OnCommand(CommandEventArgs e)
* bei System.Web.UI.WebControls.Button.RaisePostBackEvent(String eventArgument)
* bei System.Web.UI.WebControls.Button.System.Web.UI.IPostBackEventHandler.RaisePostBackEvent(String eventArgument)
* bei System.Web.UI.Page.RaisePostBackEvent(IPostBackEventHandler sourceControl, String eventArgument)
* bei System.Web.UI.Page.RaisePostBackEvent(NameValueCollection postData)
* bei System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint)

Associated revisions

Revision 6282225e9a3f7acf2b57a65e02017094c29d4671
Added by Daniel Nauck over 3 years ago

don't close connection in UpdateFailureCount before failure update, fixes #6

History

Updated by Daniel Nauck over 3 years ago

Hi,

i've found the problem.

In source:trunk/PgMembershipProvider.cs@1522 is a finally clause that cloeses the current connection. In the next step the same connection is reused to update the failture count. Result is the mentioned exception.

I'll commit a bugfix as soon as possible.

Thanks for the bugreport.

Updated by Daniel Nauck over 3 years ago

  • 1 set to fixed

Fixed in changeset r6.

Updated by Daniel Nauck over 3 years ago

It was Changeset r99.

Also available in: Atom PDF