[CoreLab] Session state problem : primary key error
[CoreLab] Session state problem : primary key error
Hello,
I have a web farm with 2 servers (load balancing).
I use CoreLab (4.50.30.0) session state provider for Oracle 10g.
Overall, the session persistence works.
But sometimes, an error occurs.
Error description :
Exception information:
Exception type: OracleException
Exception message: ORA-00001: unique constraint (ORACLE.ASPNET_SESSIONS_SESSIONID_PK) violated
Request information:
Request URL: ******
User host address: ******
User:
Is authenticated: False
Authentication Type:
Thread account name: NT AUTHORITY\NETWORK SERVICE
Thread information:
Thread ID: 5
Thread account name: NT AUTHORITY\NETWORK SERVICE
Is impersonating: True
Stack trace: at CoreLab.Common.Web.Providers.DbSessionStateStore.SetAndReleaseItemExclusive(HttpContext context, String id, SessionStateStoreData item, Object lockId, Boolean newItem)
at System.Web.SessionState.SessionStateModule.OnReleaseState(Object source, EventArgs eventArgs)
at System.Web.HttpApplication.SyncEventExecutionStep.System.Web.HttpApplication.IExecutionStep.Execute()
at System.Web.HttpApplication.ExecuteStep(IExecutionStep step, Boolean& completedSynchronously)
Web.Config data :
After analysis of SetAndReleaseItemExclusive method (with reflector), a SQL request must delete my session :
"DELETE FROM aspnet_sessions WHERE sessionid = :sessionid AND LOWER(applicationname) = :applicationname AND expires SQL request does not delete my session.
Can you explain why this error occurs ? And what is the solution ?
Is this problem would be fixed in the new version of dotConnect for Oracle ?
Thank you very much.
I have a web farm with 2 servers (load balancing).
I use CoreLab (4.50.30.0) session state provider for Oracle 10g.
Overall, the session persistence works.
But sometimes, an error occurs.
Error description :
Exception information:
Exception type: OracleException
Exception message: ORA-00001: unique constraint (ORACLE.ASPNET_SESSIONS_SESSIONID_PK) violated
Request information:
Request URL: ******
User host address: ******
User:
Is authenticated: False
Authentication Type:
Thread account name: NT AUTHORITY\NETWORK SERVICE
Thread information:
Thread ID: 5
Thread account name: NT AUTHORITY\NETWORK SERVICE
Is impersonating: True
Stack trace: at CoreLab.Common.Web.Providers.DbSessionStateStore.SetAndReleaseItemExclusive(HttpContext context, String id, SessionStateStoreData item, Object lockId, Boolean newItem)
at System.Web.SessionState.SessionStateModule.OnReleaseState(Object source, EventArgs eventArgs)
at System.Web.HttpApplication.SyncEventExecutionStep.System.Web.HttpApplication.IExecutionStep.Execute()
at System.Web.HttpApplication.ExecuteStep(IExecutionStep step, Boolean& completedSynchronously)
Web.Config data :
After analysis of SetAndReleaseItemExclusive method (with reflector), a SQL request must delete my session :
"DELETE FROM aspnet_sessions WHERE sessionid = :sessionid AND LOWER(applicationname) = :applicationname AND expires SQL request does not delete my session.
Can you explain why this error occurs ? And what is the solution ?
Is this problem would be fixed in the new version of dotConnect for Oracle ?
Thank you very much.
-
- Devart Team
- Posts: 1710
- Joined: Thu 03 Dec 2009 10:48
Could you please send us a small test project so that we are able to reproduce and ivestigate the problem?
Sorry for the late reply.
I don't think a test project is interesting because problem doesn't occur constantly.
I think the problem is the parameter "regenerateExpiredSessionId" which is set to "true".
So an existing Session ID can be reused for an other session ?
Do you know what is the exact use of this parameter ? (MSDN isn't very clear)
What do you think about this ?
I don't think a test project is interesting because problem doesn't occur constantly.
I think the problem is the parameter "regenerateExpiredSessionId" which is set to "true".
So an existing Session ID can be reused for an other session ?
Do you know what is the exact use of this parameter ? (MSDN isn't very clear)
What do you think about this ?
I have found root
I have one domain name and 2 asp.net web site.
http://myDomain/binApp1/
http://myDomain/binApp2/
=> Asp.net generate the same session id for 2 applications.
(Session id is generated from domain name).
When I access to binApp1, a row is inserted into ASPNET_SESSIONS table.
When I access to binApp2, error occurs.
Why ?
Because ASPNET_SESSIONS primary key is SESSIONID column.
More, binApp1 and binApp2 have same session id, but different application name !
I suggest to set ASPNET_SESSIONS primary key on SESSIONID and APPLICATIONNAME columns.
I test it, and it works.
Why do you think about this ?
Thank you!
I have one domain name and 2 asp.net web site.
http://myDomain/binApp1/
http://myDomain/binApp2/
=> Asp.net generate the same session id for 2 applications.
(Session id is generated from domain name).
When I access to binApp1, a row is inserted into ASPNET_SESSIONS table.
When I access to binApp2, error occurs.
Why ?
Because ASPNET_SESSIONS primary key is SESSIONID column.
More, binApp1 and binApp2 have same session id, but different application name !
I suggest to set ASPNET_SESSIONS primary key on SESSIONID and APPLICATIONNAME columns.
I test it, and it works.
Why do you think about this ?
Thank you!
-
- Devart Team
- Posts: 1710
- Joined: Thu 03 Dec 2009 10:48
Same problem
I have the same problem with devart version 5.35.79. It would be great if you could tell us if this temporary solution works?
I cannot reproduce the mentioned problem with my IIS at the moment. A different session id is generated for every application deployed on IIS in my environment. We are investigating the issue. As Clemox mentioned, please try setting ASPNET_SESSIONS primary key on SESSIONID and APPLICATIONNAME columns.
-
- Devart Team
- Posts: 1710
- Joined: Thu 03 Dec 2009 10:48
We've released dotConnect for Oracle 5.70.152 which contains the fixed scripts that create the ASPNET_SESSIONS table. The key now consists of both SESSIONID and APPLICATIONNAME columns. The new build can be downloaded from
http://www.devart.com/dotconnect/oracle/download.html
(the trial version) or from Registered Users' Area (for users with active subscription):
http://secure.devart.com/
For more information on improvements and fixes available in the 5.70.152 version, please refer to
http://www.devart.com/forums/viewtopic.php?t=18588
http://www.devart.com/dotconnect/oracle/download.html
(the trial version) or from Registered Users' Area (for users with active subscription):
http://secure.devart.com/
For more information on improvements and fixes available in the 5.70.152 version, please refer to
http://www.devart.com/forums/viewtopic.php?t=18588