Beefy Boxes and Bandwidth Generously Provided by pair Networks
Keep It Simple, Stupid
 
PerlMonks  

Re: Mysql handle not in asynchronous mode

by Anonymous Monk
on Jul 16, 2011 at 06:39 UTC ( #914806=note: print w/ replies, xml ) Need Help??


in reply to Mysql handle not in asynchronous mode

and am wondering if this is the cause and the solution of my problem. Would a DBI/mysql savvy monk kindly elucidate?

That would seem to be the cause of your problems -- turning on this async feature, means you have to wait after execute before you can fetch

So the solution would be to comb your code (or whatever abstraction you're using), to make sure async is turned off

Or add the loop as per async docs, to wait before fetching


Comment on Re: Mysql handle not in asynchronous mode
Re^2: Mysql handle not in asynchronous mode
by punkish (Priest) on Jul 16, 2011 at 15:57 UTC
    I am not using any abstraction... just pure DBI. And, I have done nothing to turn on the async feature. In fact, now your reply has confused me even more, as you seem to imply that I might have that feature on, and that I have to try and turn it off. I thought it was just the other way around.

    I am making Ajax calls. It could be that Dancer, which tends to use a lot of global cars, is causing this problem. But, these calls are to separate Starman instances, albeit on the same computer, and they are making separate calls the the db, albeit, the same db.

    addendum: the above note is confusing, so I would appreciate some explanation. Wouldn't it be normal to first execute and then fetch? After all, that is how my code is written. As I said above in my OP, Perl doesn't just jump over lines of code. So, the only conclusion I can derive is that one call to the db is made, and before the db can respond to it, another call comes in. The db gets confused, and tries to fetch (from the first call) on the second call that hasn't executed yet. This would imply that there is namespace pollution going on... vars from different web calls are clobbering each other.



    when small people start casting long shadows, it is time to go to bed

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://914806]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others romping around the Monastery: (8)
As of 2014-11-27 03:15 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    My preferred Perl binaries come from:














    Results (178 votes), past polls