Socket closed for SQL Server Connector

Hello everyone,
@ipazin @armingrudd @badger101
I have a workflow in which I try to connect to SQL Server in a MetaNode and pass the connection to output port of MetaNode.
I am running this workflow in batch mode. Now the error is, when I try to run the workflow from KNIME it works like a charm but when running from batch file,
it says Failing Message:
I/O Error: Socket closed.
Failing Node:
Microsoft SQL Server Connector.

This error occurs several times a day and for the rest of the runs, it works fine. (My workflow runs every hour).

This is how the MetaNode looks like:

This is me trying to retry if the Socket Closed error occurs but it is having an issue that “Loop Body wired incorrectly (Branches are not permitted to leave loops”

Can you please suggest how can I reexecute the SQL SERVER node when the Socket Closed error occurs?