[Dancer-users] mysterious behavior putting Dancer app in production on Starman
David Precious
davidp at preshweb.co.uk
Fri Jul 15 22:48:32 CEST 2011
On Friday 15 July 2011 02:55:55 Mr. Puneet Kishor wrote:
> Here is the interesting thing -- if I add the -D switch to the second app
> as well, it fails to return the polys and the points. It fails with the
> error
>
> {"error":"Warning caught during route execution: DBD::mysql::st
> fetchall_arrayref failed: fetch() without execute() at
> <path/to>/macrostrat.pm line 79.\n"}
>
> The offending lines are
>
> 71> my $sql = qq{
> 72> ..
> 73>
> 74>
> 75> };
> 76>
> 77> my $sth = $dbh->prepare($sql);
> 78> $sth->execute();
> 79> my $res = $sth->fetchall_arrayref({});
>
> The above could be just correlation rather than causal, but it definitely
> seems to be a pattern. First, this is bizarre, and why so? And, two...
> this is totally bogus... how can execute() not take place above? Perl
> doesn't have a habit of jumping over lines, does it?
You haven't actually performed any error checking; either make sure RaiseError
is enabled on your database handle, or check for errors, e.g.:
$sth->execute()
or die "Failed to execute query - " . $dbh->errstr;
As for why the behaviour changed when you selected the production environment,
perhaps it's down to differing settings in enviroments/development.yml and
environments/production.yml ?
--
David Precious ("bigpresh")
http://www.preshweb.co.uk/
"Programming is like sex. One mistake and you have to support
it for the rest of your life". (Michael Sinz)
More information about the Dancer-users
mailing list