http://www.perlmonks.org?node_id=774751

reasonablekeith has asked for the wisdom of the Perl Monks concerning the following question:

I have a Catalyst app that builds some graphs which is occasionally giving screwy results. It will be fine, and then the result set suddenly returns, missing values. I've boiled an example down to the code as follows.
package myapp::Controller::tests::report; use strict; use warnings; use parent 'Catalyst::Controller'; sub day_simple :Local :Args(2) { my ( $self, $c, $test_id, $passed_date) = @_; my @passed_date_split = split /\D/, $passed_date; my $formatted_passed_date = join '-', @passed_date_split; my $tests_rs = $c->model('DB::Tests')->search( { name => { '=', $test_id }, date_time => { '>=', "$formatted_passed_date 00:00:00", +'<=', "$formatted_passed_date 23:59:59" }, }, { order_by => 'date_time', }, ); my $output = ""; while (my $row = $tests_rs->next) { $output .= $row->get_column('date_time') . ", " . $row->get_co +lumn('time_taken') . "<br/>\n"; } $c->response->body( $output ); }
which when run gives
2009-06-24 00:03:41, 0.952 2009-06-24 00:14:06, 0.968 2009-06-24 00:24:31, 0.968 2009-06-24 00:34:50, 0.812 2009-06-24 00:45:17, 0.844 2009-06-24 00:55:49, 1.577 , 0.921 2009-06-24 01:16:29, 0.812 2009-06-24 01:26:50, 1.39 2009-06-24 01:37:35, 8.387 2009-06-24 01:48:24, 1.181 , 0.847 2009-06-24 02:09:19, 1.739 2009-06-24 02:19:49, 0.877 etc...
All those lines are there in the database all with valid date_time value (as implied by the order by date_time directive).

Very wierdly, runing a select over this table from a mysql command shell seems to clear this problem, and the values start returning normally for a while, but the problem always comes back. Bouncing apache has no effect.

I'm running active perl v5.10.0, apache 2.2.11.0, Win Server 2003, DBIx::Class v0.08010, Catalyst 5.71001 and modperl 1.99.

Any help/pointers much appreciated.

Thanks.

Rob

---
my name's not Keith, and I'm not reasonable.