good chemistry is complicated,
and a little bit messy -LW
Mysql handle not in asynchronous modeby punkish (Priest)
|on Jul 16, 2011 at 02:58 UTC||Need Help??|
punkish has asked for the
wisdom of the Perl Monks concerning the following question:
I asked this question on the dbi list (no response yet), so am posting it here for collective wisdom of the monks.
I have three MySQL/Perl Dancer http://perldancer.org powered web apps.
The user goes to app A which serves up a Google maps base layer. On document ready, app A makes three jQuery ajax calls -- two to app B like so
and one to app C
Apps B and C query the MySQL database via DBI, and serve up json packets of points and polys that are rendered in the user's browser.
All three apps are proxies through Apache to Perl Starman running via plackup started like so
From time to time, I start getting errors back from the apps called via Ajax. The initial symptoms were
The offending lines are
This is bizarre... how can execute() not take place above? Perl doesn't have a habit of jumping over lines, does it? So, I turned on DBI_TRACE
And, following is what stood out to me as the potential culprit in the log file
What is going on? Basically, as is, app A is non-functional because the other apps don't return data "reliably" -- I put that in quotes because they do work correctly occasionally, so I know I don't have any logic or syntax errors in my code. I have some kind of intrinsic plumbing errors.
quick update: I did find the following http://search.cpan.org/~capttofu/DBD-mysql-4.019/lib/DBD/mysql.pm#ASYNCHRONOUS_QUERIES and am wondering if this is the cause and the solution of my problem. Would a DBI/mysql savvy monk kindly elucidate?
when small people start casting long shadows, it is time to go to bed