There is a C# software that reads and collects telegrams from the controller, writes the data to the Oracle database.
It reads telegrams in a loop, the controller itself has a counter of 200 telegrams.
The algorithm is as follows – a telegram comes with a certain sign to read it. The software parses and writes to the database, usually it takes less than 10 seconds. But at some point the time starts to increase, reaching up to 5 minutes or more.
At this point a whole cycle is already passing, that is, if one telegram, for example, was 180, the next one will be 181, but of a different cycle.
The code for recording in the database:
var cmdText = string.Format("BEGIN " +
"INSERT INTO {0} " +
"(counter, oper_id, eventtime, aggr_no, heat_no, status, par1, par2, par3, par4, par5, par6) " +
"VALUES " +
"(:v_counter, :v_oper_id, :v_eventtime, :v_aggr_no, :v_heat_no, :v_status, :v_par1, :v_par2, :v_par3, :v_par4, :v_par5, :v_par6); COMMIT; " +
"EXCEPTION " +
"WHEN OTHERS THEN :v_message := SQLERRM; ROLLBACK; " +
"END;", _tableName);
var oraCommand = new OracleCommand(cmdText, Connection);
Can you tell me how to speed up the addition to the database? Maybe by using a stored procedure or EF?