I'm using .Net 2.0, ADO.NET, a dataset and data adapters to manage my data, and Microsoft SQL Server 2005 as database manager.
I have an application that generates a great number of results (500K+) and saves them in a database. If one result generation fails, I would like to not save any of the results. So I put all the database inserts within a transaction that gets rolled back if a result cannot be generated.
However the table gets locked down until all the results are written, which is not what I intended. Or at least I guess it is locked down, no SELECT query responds until the insertion ends.
Is there a way to make the the transaction to not lock the table while a transaction is active?
Is it even a good idea to use a transaction with so many inserts being made?