2
votes

I have just started using node-red and have setup a flow to connect to 3 mssql databases and export the results to mqtt, each has its own connection.

However when running the flow i get "ConnectionError: Connection is closed." on at least one of the connections. If i disable two of the connections and run it works fine, it seems as though node-red cannot handle two or more db connections at the same time.

Is there any workaround to this?

1
Use multiple processes if that's truly the issue. ¯\_(ツ)_/¯ Multiple node processes won't share the same connection pool. - Dan
There is nothing obvious in the Node-RED mysql node that would cause this, unless it's a property of the underlying mysql node - hardillb
the mysql nodes work fine, the issue is with mssql - jcordingley

1 Answers

1
votes

Are your nodes set up in parallel or in series?

If your not doing this already, try to connect all nodes in series so that only 1 node can run at a time, each after the the last.

For me, I was trying to insert data into 2 different tables using seperate nodes but in parallel (at the same time) and I would get intermittent "ConnectionError: Connection is closed." errors.

Once I changed the flow to only run 1 node at a time, one after the other (in series), that my "ConnectionError: Connection is closed." errors stopped