a. Considering the default model of working with database inserts - loop over a recordList and then call execSQL within :
try (exit on failure) -- initialize -- other steps and invocations loop over recordList execSQL(s) catch error handling
Does that mean execSQL is going to
Commit (AutoCommit in case of SQLServer)
for each loop pass through?
If the above is true, then a better approach would be to use single database connection and loop through the recordList
try (exit on failure) connect start transaction inner try (exit on failure) loop over recordList execSQL(s) inner catch error handling rollback clear transaction close catch error handling
Wanted to know if the second approach is better than the first for performance and better eror handling?
b. Also how does one code this in flow
if transaction is not cleared cleartransaction if connection is open close