Zebra_Session
Zebra_Session copied to clipboard
get_lock doesn't work
This is probably a local issue but I'm stumped.
function read($session_id) (around line 500) fails with 'Zebra_Session: Could not obtain session lock'
If I dump the contents of result it shows that it contains no data - 0 rows. No error or warning is logged.
Any ideas?
you are probably using the same session in another tab and that is doing something that takes a long time and thus not releasing the lock.
call session_write_close()
before engaging in something that take a long time to process so you can continue to use the same session
I don't think so. The application doesn't run at all and it's just me on a test server. There's nothing else running. It's failing at (I presume) session_start.
It's coming back with this error instantly. It's not timing out. The timeout is the default 60 seconds. It's MySQL 8 if it makes any difference.
The problem is that rowCount() returns zero for the SELECT. I'm using Idiorm for database access and that is supplying the PDO object. I imagine it's changing some setting but I'm yet to spot what.
Some reading around casts doubt on the wisdom rowCount(). There seem to be a number of problems.
As far as I can tell your function query() for PDO only ever returns a single row of data, so the 'count' is really just a boolean anyway. Is there data or isn't there.