I use ASP.NET user controls as Web Parts and have a Personalization Provider that uses a MS Access DB as the backend. All has been working fine till recently. Intermittently I'm getting "System.Data.OleDb.OleDbException: Could not save; currently
locked by another user" with such a stack trace:
[Page_Error] System.Data.OleDb.OleDbException: Could not save; currently locked by another user. at System.Data.OleDb.OleDbCommand.ExecuteCommandTextErrorHandling(OleDbHResult hr)
at System.Data.OleDb.OleDbCommand.ExecuteCommandTextForSingleResult(tagDBPARAMS dbParams, Object& executeResult)
at System.Data.OleDb.OleDbCommand.ExecuteCommandText(Object& executeResult)
at System.Data.OleDb.OleDbCommand.ExecuteCommand(CommandBehavior behavior, Object& executeResult)
at System.Data.OleDb.OleDbCommand.ExecuteReaderInternal(CommandBehavior behavior, String method)
at System.Data.OleDb.OleDbCommand.ExecuteNonQuery()
...
at System.Web.UI.WebControls.WebParts.PersonalizationProvider.SavePersonalizationState(PersonalizationState state)
at System.Web.UI.WebControls.WebParts.WebPartPersonalization.Save()
at System.Web.UI.WebControls.WebParts.WebPartManager.OnPageSaveStateComplete(Object sender, EventArgs e)
at System.EventHandler.Invoke(Object sender, EventArgs e)
at System.Web.UI.Page.OnSaveStateComplete(EventArgs e)
at System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint)
Probably MS Access page-level locking when updating memo fields (which store the personlization "blob" is causing this? It happens even for only one user as the user navigates away from the page, reloads it and more.
Also, each User Control, has some primitive properties marked Personalizable and some reference types such as List
<int> which are marked
Personalizable as well but I also implement IPersonalizable as well to correctly serialize such reference types and mark the personalization "dirty" to trigger such reference properties to be saved.
Would that be causing problem by any chance? That is, could it be that ASP.NET web part framework is trying to automatically save the properties marked as Personalizable and UserConrol is trying to save as well via
the implementation of IPersonalizable.Save method and, all that being done at the same time, causing such a record locking error? Should either all properties that need to be personalized should be marked either Personalizable or manually
loaded and saved via IPersonalizable.Save method but NOT both?
I'm using ASP.NET 3.5 SP1.
Thanks in advance for any and all pointers to best resolve this!
nmishra
Member
10 Points
128 Posts
Using Personalizable property and IPersonalizable together?
Jan 21, 2013 07:04 PM|LINK
Hi,
I use ASP.NET user controls as Web Parts and have a Personalization Provider that uses a MS Access DB as the backend. All has been working fine till recently. Intermittently I'm getting "System.Data.OleDb.OleDbException: Could not save; currently locked by another user" with such a stack trace:
[Page_Error] System.Data.OleDb.OleDbException: Could not save; currently locked by another user. at System.Data.OleDb.OleDbCommand.ExecuteCommandTextErrorHandling(OleDbHResult hr)
at System.Data.OleDb.OleDbCommand.ExecuteCommandTextForSingleResult(tagDBPARAMS dbParams, Object& executeResult)
at System.Data.OleDb.OleDbCommand.ExecuteCommandText(Object& executeResult)
at System.Data.OleDb.OleDbCommand.ExecuteCommand(CommandBehavior behavior, Object& executeResult)
at System.Data.OleDb.OleDbCommand.ExecuteReaderInternal(CommandBehavior behavior, String method)
at System.Data.OleDb.OleDbCommand.ExecuteNonQuery()
...
at System.Web.UI.WebControls.WebParts.PersonalizationProvider.SavePersonalizationState(PersonalizationState state)
at System.Web.UI.WebControls.WebParts.WebPartPersonalization.Save()
at System.Web.UI.WebControls.WebParts.WebPartManager.OnPageSaveStateComplete(Object sender, EventArgs e)
at System.EventHandler.Invoke(Object sender, EventArgs e)
at System.Web.UI.Page.OnSaveStateComplete(EventArgs e)
at System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint)
Probably MS Access page-level locking when updating memo fields (which store the personlization "blob" is causing this? It happens even for only one user as the user navigates away from the page, reloads it and more.
Also, each User Control, has some primitive properties marked Personalizable and some reference types such as List <int> which are marked Personalizable as well but I also implement IPersonalizable as well to correctly serialize such reference types and mark the personalization "dirty" to trigger such reference properties to be saved.
Would that be causing problem by any chance? That is, could it be that ASP.NET web part framework is trying to automatically save the properties marked as Personalizable and UserConrol is trying to save as well via the implementation of IPersonalizable.Save method and, all that being done at the same time, causing such a record locking error? Should either all properties that need to be personalized should be marked either Personalizable or manually loaded and saved via IPersonalizable.Save method but NOT both?
I'm using ASP.NET 3.5 SP1.
Thanks in advance for any and all pointers to best resolve this!
nmishra
Member
10 Points
128 Posts
Re: Using Personalizable property and IPersonalizable together?
Jan 22, 2013 06:57 PM|LINK
Any pointers in this regard? Thanks in advance.