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: Catalyst@lists.scsys.co.uk
Listinfo: http://lists.scsys.co.uk/cgi-bin/mailman/listinfo/catalyst
Searchable archive: http://www.mail-archive.com/catalyst@lists.scsys.co.uk/
Dev site: http://dev.catalyst.perl.org/

Reply via email to