ExecuteNonQuery timeout issue

I am trying to execute this query with OrmLite:

_db.ExecuteNonQuery($ "insert into {tableName} (id, isbn, isbn13, ean, price, discount, free_stock, report, report_date) " +
                                    $ "select id, isbn, isbn13, ean, price, discount, free_stock, report, report_date " +
                                    $ "from {tempTableName}");

This generates an exception:

A connection attempt failed because the connected party did not properly respond after a period of time, or established connection failed because connected host has failed to respond

It is a large table, the query takes about 45 seconds to complete if I run it manually. My CommandTimeout is set to 0.


The connection string property doesn’t seem to work but setting _db.SetCommandTimeout(10000000); fixed it. Query runs now without timing out

1 Like

I don’t think that exception is the same thing as a command timing out. That looks like inability to establish a connection, firewall or db load issue?

It’s failing to respond within the command timeout because the query took too long to run, hence why increasing the command timeout resolves it.