Hi Rob,

Thanks for the input. Yeah, I need to dedicate a bunch of time to looking at 
this and paring it down to find where the problem occurs. The major headache 
there is that I use this system heavily every day, and I might see the issue a 
couple of times a month. I just haven't been able to reproduce it, despite 
trying to replicate the usage when I have observed it.

If the stash is just a request specific hashref then I must have 
reassignment/modification of one of the objects somewhere.

Thanks,

DT 



-----Original Message-----
From: Robert Brown [mailto:[email protected]] 
Sent: Friday, April 25, 2014 2:18 PM
To: [email protected]
Subject: Re: [Catalyst] Inconsistency when retrieving objects from stash

Hi Dave,

 From what I understand, there is nothing "magical" about the stash, it's 
basically a hash reference, used once per request, that is all.

So, I would suggest you look at debugging more the objects you're storing in 
the stash, and how they may change during the request cycle.

You would need to supply more code samples/examples.

If you can, start stripping away what's not necessary and still be able to 
re-produce the problem, it will most probably highlight the issue by itself.

Otherwise, reply back with a full working example.

Ideally use something like http://paste.scsys.co.uk to paste your code 
snippets, post as much as you can, it's usually the subtle bits you don't think 
are important where the actual issue lies.


Rob


On 04/25/2014 08:08 PM, David Trudgian wrote:
> Hi,
>
> I'm observing a frustrating problem where the following happens:
>
> A Catalyst controller retrieves a 'search' object and the related parent 
> 'submission' object from a DBIC schema instance. It puts them into the stash:
>
>    $c->model('CPFP')->schema->resultset('Searches')->find($sch_id);
>    $c->stash->{search}     = $search;
>    $c->stash->{submission} = $search->submission;
>
> Now, the relationships here mean it's always the case that 
> $search->submission->sub_id = $submission->sub_id
>
> However, when forwarded to the view (TT2 HTML or Excel Template Plus based), 
> occasionally the search and submission pulled back out of the stash in the 
> template are inconsistent. The following trap in the template will throw an 
> error:
>
> [% IF search.submission.sub_id != submission.sub_id %]
>    [% THROW mismatch "Fatal Error SCH-SUB-ID != SUB-ID" %] [% END %]
>
> I don't understand how this is possible, given the way the stash values are 
> set in the controller. It occurs infrequently, and I can't find a situation 
> that reproducibly causes it. The app is running under fastcgi on Apache.
>
> Any thoughts on what to look at would be much appreciated. I was considering 
> session crossover as a cause, so ensured there was entropy on the server, set 
> no-cache headers for proxies etc. However, I have now seen this occur on a 
> development machine with only me connected to the app. I don't understand 
> well enough how the stash works in order to know what might affect the 
> consistency like this.
>
> Any help greatly appreciated!
>
> Dave Trudgian
>
>
>
> ________________________________
>
> UT Southwestern Medical Center
> The future of medicine, today.
>
>
> _______________________________________________
> List: [email protected]
> Listinfo: http://lists.scsys.co.uk/cgi-bin/mailman/listinfo/catalyst
> Searchable archive: 
> http://www.mail-archive.com/[email protected]/
> Dev site: http://dev.catalyst.perl.org/


_______________________________________________
List: [email protected]
Listinfo: http://lists.scsys.co.uk/cgi-bin/mailman/listinfo/catalyst
Searchable archive: http://www.mail-archive.com/[email protected]/
Dev site: http://dev.catalyst.perl.org/


_______________________________________________
List: [email protected]
Listinfo: http://lists.scsys.co.uk/cgi-bin/mailman/listinfo/catalyst
Searchable archive: http://www.mail-archive.com/[email protected]/
Dev site: http://dev.catalyst.perl.org/

Reply via email to