Zebra_Session icon indicating copy to clipboard operation
Zebra_Session copied to clipboard

get_lock doesn't work

Open thepurpleblob opened this issue 3 years ago • 3 comments

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?

thepurpleblob avatar Mar 27 '21 14:03 thepurpleblob

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

stefangabos avatar Mar 27 '21 14:03 stefangabos

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.

thepurpleblob avatar Mar 27 '21 15:03 thepurpleblob

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.

thepurpleblob avatar Apr 05 '21 12:04 thepurpleblob