But when I wanted to use the functionality of updating data through transactions I got the following error: Error: Cannot enqueue Query after invoking quit. In pseudocode, this is what I did var lineCounter = 0 Īgain, different situation might require different way to find the last time the connection.query() will be called. Ive been implementing MySQL for NodeJS and Restify and everything has worked perfectly in terms of queries. If original process has made the last call, then call connection.end() in the last callback of the last asynchronous chained function.įor the program I was working on, I counted the lines that was read from the file and I matched the count to another counter counting how many records I have inserted. I put connection. Apparently they pushed in unnecessary code in their last iteration that is also bugged. Database connection error: Error: Cannot enqueue Query after invoking quit. TL DR You need to establish a new connection by calling the createConnection method after every disconnection. Hi gayanhewa I can't help you if you don't specify what exactly the failure is plus, which version of node you use and a log from a run in the verbose mode (-v). However, the general idea is to keep track of the original process (in this case reading my file) and check against the last process (in this case my sql insert). Cannot enqueue Handshake after invoking quit If you using the node-mysql module, just remove the. Cannot enqueue Handshake after invoking quit. With multiple chained asynchronous callbacks, how could I know when will that last connection.query() be called?ĭifferent problems may require different exact implementation. Eureka! I need to call it after the last connection.query() ran. Try using this code to call connection. “cannot enqueue query after invoking quit”Īfter another few hours of searching the web, node-inspector debugging, and tons of debugger command and console.log(), the dark cloud was lifted away. Maybe the problem is that the mySQL query is executed after the connection is already closed, due to the asynchronous nature of Node. After a few hours, as I thought I’m close to being done, I get this error: So here I am with node.js, chrome dev tool, asynchronous functions everywhere, trying to process information from a file and insert them into mysql. What better way to go back at it than working with a framework that I have never code in before? Using tools that I’ve never used before! Of course! (Sarcastic laugh, then cry…) 这段代码未从我的api中的models/user.After years focusing almost exclusively on management and a bit of high level enterprise system architecture, I’m starting to code again. Mysql_connection = mysql.createConnection(configs) Ĭonsole.log(`getUserByEmail: connection id: $) Ĭonsole.log(ctime.getTime(), 'user data: ', er_id)Ĭonsole.log(ctime.getTime(), 'user data: ', er_id) end()call is coming from file C:UsersIainSteambotEditedBotJS.js, line 139. I see that from the error, the particular call happening after the. These are PRIVATE variables, they can only be accessed within this class node.js Cannot enqueue Handshake after invoking quitEllen1995- node. The error you provided is because you are chronologically calling connection.query()after you called connection.end(). Liferay fail-over) Could not write content: No serializer found for class and no properties discovered to create BeanSerializer Add Solution: A timeout has occurred while invoking commands in SharePoint host process. The code is posted at the very bottom but if I comment out the small section directly below, which is attempting the mysql insert there are no errors when running. * This constructor function is responsible for running queries against node Cannot enqueue Quit after invoking quit. Publius Asks: Insert failing with 'Error: Cannot enqueue Query after invoking quit.' I have a javascript file that is attempting to insert just two static values into a mysql table. Error: Cannot enqueue Query after invoking quit.at Protocol. 17 comments gayanhewa commented on Used configuration tweaks.GitHub Closed gayanhewa opened this issue on. When we connect to the database, it may be the first time to use. Error: Cannot enqueue Quit after invoking quit
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |