[Dancer-users] mysterious behavior putting Dancer app in production on Starman
Mr. Puneet Kishor
punk.kish at gmail.com
Fri Jul 15 03:55:55 CEST 2011
Check out the following [http://teststrata.geology.wisc.edu/macromap]. It should be working -- it should show a Google map backdrop with a bunch of polygons and a few points. As you pan and zoom, polys and points for the new viewport should be retrieved.
The polys and points are retrieved via ajax from [http://teststrata.geology.wisc.edu/mstrat/] that is serving them from a MySQL db as a REST service.
Both apps are Dancer based, and are running on Starman using the following invocation
$ plackup -p <port> -E production -s Starman -w 10 -a bin/app.pl
The first app (macromap) also has the -D switch added to the above plackup command so plackup runs in the background as a daemon (or a faceless app, or whatever is the correct terminology).
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?
Absolutely mystified in Madison.
Puneet.
More information about the Dancer-users
mailing list