3

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?

hardillb
  • 54,545
  • 11
  • 67
  • 105
  • Use multiple processes if that's truly the issue. ¯\\_(ツ)_/¯ Multiple node processes won't share the same connection pool. – Dan Oct 30 '18 at 10:41
  • 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 Oct 30 '18 at 11:10
  • the mysql nodes work fine, the issue is with mssql – jcordingley Oct 30 '18 at 11:30

1 Answers1

1

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

knowledgy
  • 33
  • 7