?
avatar andrepereiradasilva
andrepereiradasilva
20 Sep 2016

Steps to reproduce the issue

Enable debug and system debug plugin.
Login in the frontend and check the Database queries in system debug plugin info.

image

image

Call stack for both
image

Expected result

Just two DB queries.

Actual result

Four DB queries.

System information (as much as possible)

Latest staging

Additional comments

@mbabker i don't really know how joomla sessions work. is there a particular reason for this?

avatar andrepereiradasilva andrepereiradasilva - open - 20 Sep 2016
avatar mbabker
mbabker - comment - 20 Sep 2016

If the call stack for the 31st and 32nd queries (which should be the end of the application cycle) is the exact same as the 3rd and 4th queries at the beginning of the application cycle, I'd say there are a lot of bigger issues here. Instead of just raising a flag because the debug console says the queries are duplicated, you'll have to dig into the call stacks and figure out what's triggering the code on each side. The first two are definitely because the user data is unserialized out of the session, but I haven't a clue what the last two are for.

avatar zero-24 zero-24 - change - 20 Sep 2016
Labels Added: ?
avatar andrepereiradasilva
andrepereiradasilva - comment - 20 Sep 2016

Instead of just raising a flag because the debug console says the queries are duplicated

? is a nice way to found issues
Hmm just making sure there wasn't some known session process or something. that's way i asked.

you'll have to dig into the call stacks and figure out what's triggering the code on each side.

The first two are definitely because the user data is unserialized out of the session, but I haven't a clue what the last two are for.

First ones:
image

Last ones:
image

if i'm reading the call stack correctly it seems is the system debug plugin that does the two extra queries...

avatar mbabker
mbabker - comment - 20 Sep 2016

Yep. After the issues at the end of 3.4, JSession was changed so that when you request all data from the store it returns a clone of the internal data object (the Registry). IIRC the unserialized JUser object is never directly stored back to the data object (or if it is it's through some wizardry of PHP) so the clone has a serialized version of the object that needs unserialized again.

avatar mbabker
mbabker - comment - 20 Sep 2016

At the end of the day context is important. I could have three modules all executing the same query:

SELECT * FROM jos_content WHERE id = 1;

The console would report duplicate queries but in context the only data source the modules are sharing is the database driver so it'd give a "valid" reason for the duplication. If they were going through the article model there'd only be one query because the MVC layer has data caching in front of it.

avatar andrepereiradasilva
andrepereiradasilva - comment - 20 Sep 2016

ok i understand now. closing.
thanks again for your explanation.

avatar andrepereiradasilva andrepereiradasilva - change - 20 Sep 2016
Status New Closed
Closed_Date 0000-00-00 00:00:00 2016-09-20 13:10:09
Closed_By andrepereiradasilva
avatar andrepereiradasilva andrepereiradasilva - close - 20 Sep 2016

Add a Comment

Login with GitHub to post a comment