Leider haben wir das Problem noch nicht lösen können. Wir sind aber allmählich dabei, das ganze etwas einzugrenzen.
Ich lasse zum Testen im Login-Form sehr detaillierte Informationen in ein Log-File schreiben. Dabei ist mir aufgefallen, dass er in unregelmässigen Abständen ein etwas merkwürdiges Verhalten an den Tag legt:
frmLogin.aspx
-------------
private void Page_Load(object sender, System.EventArgs e)
{
App.WriteNewLog("Information: ", "frmLogin.Page_Load()", "Start Page_Load()", this.Session.SessionID);
if (!IsPostBack)
{
SetupForm();
}
App.WriteNewLog("Information: ", "frmLogin.Page_Load()", "End Page_Load()", this.Session.SessionID);
}
private void SetupForm()
{
App.WriteNewLog("Information: ", "frmLogin.SetupForm()", "Start of Method", this.Session.SessionID);
App.UserLogout(this.Session);
App.WriteNewLog("Information: ", "frmLogin.SetupForm()", "End of Method", this.Session.SessionID);
}
App.cs
------
public static bool UserLogout(HttpSessionState aSession)
{
App.WriteNewLog("Information: ", "App.UserLogout()", "Next step: session.Clear()", aSession.SessionID);
aSession.Clear();
App.WriteNewLog("Information: ", "App.UserLogout()", "Next step: session.RemoveAll()", aSession.SessionID);
aSession.RemoveAll();
App.WriteNewLog("Information: ", "App.UserLogout()", "Next step: session.Abandon()", aSession.SessionID);
aSession.Abandon();
App.WriteNewLog("Information: ", "App.UserLogout()", "Next step: FormsAuthentication.SignOut()", aSession.SessionID);
FormsAuthentication.SignOut();
App.WriteNewLog("Information: ", "App.UserLogout()", "End of method", aSession.SessionID);
return true;
}
global.asax
-----------
protected void Session_End(Object sender, EventArgs e)
{
App.WriteNewLog("Information: ", "global.asax Session_End()", "Start of Session_End()", this.Session.SessionID);
App.decrementSessionCounter();
App.WriteNewLog("Information: ", "global.asax Session_End()", "End of Session_End()", this.Session.SessionID);
}
Die Einträge im dabei erstellten Log sehen dann wie folgt aus (aber wie erwähnt nicht jedes Mal, sondern nur von Zeit zu Zeit):
24.05.2011 14:01:13: Information: global.asax Session_Start(); Start of Session_Start(); SessionID: 'ezapidrqidtczh23khpvdgay'
24.05.2011 14:01:13: Information: global.asax Session_Start(); End of Session_Start(); SessionID: 'ezapidrqidtczh23khpvdgay'
24.05.2011 14:01:13: Information: frmLogin.Page_Load(); Start Page_Load(); SessionID: 'ezapidrqidtczh23khpvdgay'
24.05.2011 14:01:13: Information: frmLogin.SetupForm(); Start SetupForm(); SessionID: 'ezapidrqidtczh23khpvdgay'
24.05.2011 14:01:13: Information: App.UserLogout(); Next step: session.Clear(); SessionID: 'ezapidrqidtczh23khpvdgay'
24.05.2011 14:01:13: Information: App.UserLogout(); Next step: session.RemoveAll(); SessionID: 'ezapidrqidtczh23khpvdgay'
24.05.2011 14:01:13: Information: App.UserLogout(); Next step: session.Abandon(); SessionID: 'ezapidrqidtczh23khpvdgay'
24.05.2011 14:01:13: Information: App.UserLogout(); Next step: FormsAuthentication.SignOut(); SessionID: 'ezapidrqidtczh23khpvdgay'
24.05.2011 14:01:13: Information: App.UserLogout(); End of UserLogout(); SessionID: 'ezapidrqidtczh23khpvdgay'
24.05.2011 14:01:13: Information: frmLogin.SetupForm(); End of SetupForm(); SessionID: 'ezapidrqidtczh23khpvdgay'
24.05.2011 14:01:13: Information: frmLogin.Page_Load(); End Page_Load(); SessionID: 'ezapidrqidtczh23khpvdgay'
24.05.2011 14:01:34: Information: global.asax Session_End(); Start of Session_End(); SessionID: 'ezapidrqidtczh23khpvdgay'
24.05.2011 14:01:34: Information: global.asax Session_End(); End of Session_End(); SessionID: 'ezapidrqidtczh23khpvdgay'
Was mich nun irritiert ist der Zeitunterschied zwischen den beiden fett markierten Einträgen, da im Form nach der Methode Page_Load() nichts mehr aufgerufen wird. Der dazu passende Eintrag im IIS-Log hat als Zeitpunkt 14:01:34 und als Time-Taken eine Dauer von 21010 ms. Ebenfalls kommt es von Zeit zu Zeit (auch wieder in unregelmässigen Abständen) bei DB-Abfragen beim Versuch, die Connection aufzubauen, zu einem Timeout.
Weiss evt. jemand, woran das liegen könnte, resp. wo wir noch nach einem Fehler suchen könnten?
Vielen Dank im Voraus.
Gruss,
Urs