SQLite asp.net Password recovery control

Discussion in 'Databases' started by DeciduousCoder, Nov 12, 2011.

Thread Status:
Threads that have been inactive for 5 years or longer are closed to further replies. Please start a new thread.
  1. Hi, i appreciate any help ahead of time.

    I am continuing to get an error saying the database is locked when using asp.net's control PasswordRecovery.

    after the username template, and password template, I hit submit the second time and the connection times out and says the above error. The database works flawlessly with other controls and queries.

    What can I do to get this control to work? I have hashed passwords using SHA512, and wish to reset the users password and send them the new auto-generated password in an email....

    Thank you
     
  2. I updated my Question HERE:

    Here is my situation with code and error.

    I have developed an asp.net 4.0 website with SQLite3 using visual studio and I am running
    TechInfoSystems.Data.SQLiteProvider.dll
    and
    System.Data.SQLite.dll 1.0.66.0

    I just recently decided I can't save passwords for user login as clear text in my database, so I am now hashing them using SHA1. Login still works great and now the passwords are saved as one-way hex values in the database which is what I want.

    What this requires though is adequate password recovery. I put a link to reset password on the login.aspx page, this link takes you to ResetPassword.aspx which contains the asp.net control PasswordRecovery. I changed the UserName, question, and success parts into templates for a different format.

    Now, When the User is redirected to ResetPassword.aspx, user is prompted to enter their username. Great! Then click submit button, and the question template arises to ask the user what the security question answer is. Great! here is the problem, if the user enters an incorrect password, the success page is not shown, and the page sits their processing. After ~20 seconds I see an error that says the database is locked. HERE IS THAT EXACT ERROR:


    The database file is locked
    database is locked

    Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.

    Exception Details: System.Data.SQLite.SQLiteException: The database file is locked
    database is locked

    Source Error:

    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.

    Stack Trace:


    [SQLiteException (0x80004005): The database file is locked
    database is locked]
    System.Data.SQLite.SQLite3.Step(SQLiteStatement stmt) +499
    System.Data.SQLite.SQLiteDataReader.NextResult() +249
    System.Data.SQLite.SQLiteDataReader..ctor(SQLiteCommand cmd, CommandBehavior behave) +79
    System.Data.SQLite.SQLiteCommand.ExecuteReader(CommandBehavior behavior) +38
    System.Data.SQLite.SQLiteCommand.ExecuteNonQuery() +39
    TechInfoSystems.Data.SQLite.SQLiteMembershipProvider.UpdateFailureCount(String username, String failureType, Boolean isAuthenticated) +2265
    TechInfoSystems.Data.SQLite.SQLiteMembershipProvider.ResetPassword(String username, String passwordAnswer) +1760
    System.Web.Security.MembershipUser.ResetPassword(String passwordAnswer) +110
    System.Web.Security.MembershipUser.ResetPassword(String passwordAnswer, Boolean useAnswer, Boolean throwOnError) +48
    System.Web.UI.WebControls.PasswordRecovery.AttemptSendPasswordQuestionView() +374
    System.Web.UI.WebControls.PasswordRecovery.AttemptSendPassword() +77
    System.Web.UI.WebControls.PasswordRecovery.OnBubbleEvent(Object source, EventArgs e) +103
    System.Web.UI.Control.RaiseBubbleEvent(Object source, EventArgs args) +37
    System.Web.UI.WebControls.Button.OnCommand(CommandEventArgs e) +125
    System.Web.UI.WebControls.Button.RaisePostBackEvent(String eventArgument) +167
    System.Web.UI.WebControls.Button.System.Web.UI.IPostBackEventHandler.RaisePostBackEvent(String eventArgument) +10
    System.Web.UI.Page.RaisePostBackEvent(IPostBackEventHandler sourceControl, String eventArgument) +13
    System.Web.UI.Page.RaisePostBackEvent(NameValueCollection postData) +36
    System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) +5563


    IF the user enters the correct security question answer, the user sees the success page and an email is properly dispatched to the user.

    I understand people have had multithreading problems with SQLite and usually this is the error that is produced, but This provider is meant to mimmick the SQLprovider that microsoft made but for SQLite. What I mean by this is, the .net Controls that microsoft have to offer, "PasswordRecovery" should not have queries that cause concurrency issues.

    UPDATE: The c# code is embedded in one of the classes that this .NET control uses and is executed behind the scenes, so I can't pinpoint what actual method makes the database lock out. I am guessing its MembershipUser.ResetPassword(passwordAnswer). I implemented an onClick method after answering the security question that tries to manually reset the password, used that method, and thats where it locked the database.I also tried SQLiteMembershipProvider.ResetPassword(), and that also locked the database. Keep in mind, I am not explicitly making database queries, the .net providers are. So I can be sure that the queries are disposed of properly.

    I appreciate your input as I have looked for similar problems with this control and have found nothing.

    Thanks.
     
Thread Status:
Threads that have been inactive for 5 years or longer are closed to further replies. Please start a new thread.

Share This Page