Note that there are some explanatory texts on larger screens.

plurals
  1. POServer session still alive, but data being lost
    text
    copied!<p>Ok, so after a bit of fiddling I've finally identified an issue I've been having.</p> <p>I have a website that on initialization initializes different objects and fills them with data. This includes datasets and a custom controller on different pages. This problem appears to affect my site on all pages inconsistently. </p> <p>I'll go with the error I have the most detail on. I have a comment page where a person can dynamically create comment boxes and a drop down list filled with data. At initial load only one of the comment boxes are created. When you click a button, a post back occurs and another button will be loaded into a list containing all the comment boxes and the additionally comment box will be displayed.</p> <p>Now this works fine, ispostback = true and the count of the list is incremented by one. This is all hosted on a windows 2012 server under iis. The website is set for sessions through a sql server and the limit is 20 minutes for the session. The site also uses cookies that last for a month to contain some metadata. Now, if I wait for 5 minutes or so (I remain inactive at the web page), and hit the button again, what sometimes happens is that it will take awhile to load, the ispostback will be true, it will go into the addbuttonclick method and start to add the next comment box to the list, it will load the previous data for the comment box to the new one, and this is where it will error. The commentcontrol list somehow get's cleared out and the count when I receive the error is 1. Meaning that the server... cleared the comment list randomly.</p> <p>Similar problems are also plaguing other pages I have though that's more datasets getting cleared. Any help would be greatly appreciated. </p> <p>Initialization on page load</p> <pre><code> if (!IsPostBack) { DataSet BudgetCodes = new DataSet(); BudgetCodes = WFlowWS.GetBudgetCodes(); commentControl.Clear(); //intialize comment control this.CommentControl1.Ds = BudgetCodes; this.CommentControl1.FillBudgetCode(this.CommentControl1.Ds); if (commentControl.Count == 0) { commentControl.Add(this.CommentControl1); } } </code></pre> <p>The btnaddadditionalComment click</p> <pre><code> protected void btnAddAdditionalCom_Click(object sender, EventArgs e) { try { try { commentControl.Add(LoadControl("~/WorkflowCommentControl.ascx") as WorkflowCommentControl); } catch (Exception exl) { Response.Write(exl.ToString() + "line 1"); Response.End(); } try { Response.Write("ISPOSTBACK " + IsPostBack.ToString() + " COMMENT CONTROL COUNT : " + commentControl.Count().ToString() + " "); commentControl[commentControl.Count() - 1].Ds = commentControl[(commentControl.Count() - 2)].Ds; } catch (Exception exl) { Response.Write(exl.ToString() + "line 2"); Response.End(); } try { commentControl[commentControl.Count() - 1].FillBudgetCode(commentControl[commentControl.Count() - 2].Ds); } catch (Exception exl) { Response.Write(exl.ToString() + "line 3"); Response.End(); } try { this.PanelComment.Controls.Add(new LiteralControl("&lt;br/&gt;")); } catch (Exception exl) { Response.Write(exl.ToString() + "line 4"); Response.End(); } try { this.PanelComment.Controls.Add(commentControl[commentControl.Count() - 1]); } catch (Exception exl) { Response.Write(exl.ToString() + "line 5"); Response.End(); } } catch (Exception exl) { Response.Write(exl.ToString() + "line 6"); Response.End(); } } </code></pre> <p>cookie life is one month, session timeout is set for 30 minutes. </p> <p>Session state settings are sql server, </p> <p>connection string is below (slightly modified)</p> <p>Server=tcp:90210.database.windows.net,1433;Database=USState;User ID=Pirates;Password=Boats;Trusted_Connection=False;Encrypt=True;Connection Timeout=30;</p> <p>timeout 30 seconds, connection retry interval 0, enable custom database is checked.</p> <p>Cookie settings Mode: Use Cookies Name: ASP.NET_SessionId Time-out : 20</p> <p>use hosting identity for impersonation is checked</p> <p>Basic IIS setting for application pool are</p> <p>.Net Framework v4.0.30319 Managed pipeline mode: integrated Start application pool immediately is checkmarked</p> <p>Code at the very end of page load which loads each comment control</p> <pre><code>for (int x = 1; x &lt; commentControl.Count; x++) { this.PanelComment.Controls.Add(new LiteralControl("&lt;br/&gt;")); this.PanelComment.Controls.Add(commentControl[x]); } </code></pre>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload