what is the best way to open and close connections when multiple inserts are made, through a stored procedure with tedious
try {
let conn = await Con.create();
for (let i = 0; i < parameters.length; i++) {
await conn.queryExec("PRO_insertValuesClients", parameters[i]);
}
conn.end();
the problem in this way that sometimes i get the error, I don't understand what is causing the error
Failed to connect to 10.78.56.21:1433 - connect EADDRINUSE 10.78.56.21:1433
I wanted to try this way, but I don't know if it is the best or if there is another way, if you can advise me Thank you
try {
for (let i = 0; i < parameters.length; i++) {
let conn = await Con.create();
await conn.queryExec("PRO_insertValuesClients", parameters[i]);
conn.end();
}