Hi I am new to nodejs and trying the connect the Mysql. 
I am really troubled with the error *Cannot enqueue Query after fatal 
error.*
a) I am not using connection pooling so as not to complicate for start.
b) I had written connection.connect() at the start of code but removed it 
as I read in a link that it is not required. (refer below link)
Cannot enqueue Handshake after invoking quit 
<http://stackoverflow.com/questions/14087924/cannot-enqueue-handshake-after-invoking-quit>

Below is the format for all my queries.


function matchFirstName(person_name){
              var query = "select firstName,lastname, username,securityRole 
from users where firstName='"+person_name+"'" ;
              connection.query(, 
                function (err, rows) {
                    if (err || rows.length === 0) {
                        if(err){
                            console.log("error " + err);                
                            connection.end();
                        }
                    }
                    else{  
                        // some code or call to a different function which too 
might call a query in the same manner
                    }
            });
        }



Someone please suggest a permanent solution to this. 
I have tried removing connection.end() from my code as well but that too 
didnt help. This error pops up suddenly.

-- 
Job board: http://jobs.nodejs.org/
New group rules: 
https://gist.github.com/othiym23/9886289#file-moderation-policy-md
Old group rules: 
https://github.com/joyent/node/wiki/Mailing-List-Posting-Guidelines
--- 
You received this message because you are subscribed to the Google Groups 
"nodejs" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To post to this group, send email to [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/nodejs/e1830d13-fecc-4d05-b830-b76cda1a69b6%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to