in

System.Data.SQLite

An open source ADO.NET provider for the SQLite database engine

SQLite database locked by using .NET Control (PasswordRecovery)

Last post 11-14-2011 5:20 PM by JohnJohn. 2 replies.
Page 1 of 1 (3 items)
Sort Posts: Previous Next
  • 11-12-2011 2:45 PM

    SQLite database locked by using .NET Control (PasswordRecovery)

    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. This now requires I have What this situation NOW REQUIRES 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.
  • 11-14-2011 5:15 PM In reply to

    Re: SQLite database locked by using .NET Control (PasswordRecovery)

    What is this?
  • 11-14-2011 5:20 PM In reply to

    Re: SQLite database locked by using .NET Control (PasswordRecovery)

    What is what?
Page 1 of 1 (3 items)
Powered by Community Server (Commercial Edition), by Telligent Systems