CodeIgniter Forums
Problem with Sessions - Printable Version

+- CodeIgniter Forums (https://forum.codeigniter.com)
+-- Forum: Archived Discussions (https://forum.codeigniter.com/forumdisplay.php?fid=20)
+--- Forum: Archived Development & Programming (https://forum.codeigniter.com/forumdisplay.php?fid=23)
+--- Thread: Problem with Sessions (/showthread.php?tid=57953)



Problem with Sessions - El Forum - 04-29-2013

[eluser]Unknown[/eluser]
i have experimenting random errors using session helper in CI

i have no damn idea what it's happening
Code:
ERROR - 2013-04-25 09:43:08 --> Severity: Warning  --> odbc_exec(): SQL error: [Microsoft][SQL Server Native Client 10.0][SQL Server]Cannot insert duplicate key row in object 'dbo.Sesion' with unique index 'last_activity_idx'., SQL state 23000 in SQLExecDirect C:\...\system\database\drivers\odbc\odbc_driver.php 153
ERROR - 2013-04-25 09:43:08 --> Query error: [Microsoft][SQL Server Native Client 10.0][SQL Server]Cannot insert duplicate key row in object 'dbo.Sesion' with unique index 'last_activity_idx'.

this makes users to get errors randomly and needing to login again to application.
i don't have a use case to reproducing this behavior because i didn't identify a pattern in this errors.





Problem with Sessions - El Forum - 04-29-2013

[eluser]TheFuzzy0ne[/eluser]
Welcome to the CodeIgniter forums!

First of all, Session appears to be spelt incorrectly. Other than that, the error is because you have a unique key constraint on your 'last_activity' column. That shouldn't need an index on their at all, so if you remove it, I think your problem will be solved.

Hope this helps.