title: F# - FSharp.Data.SqlClient – How to specify timeout for Update
body: <p>I use <code>FSharp.Data.SqlClient</code> type providers to access SQL server database. So, I set up the types in F# something as follows:</p>
  
  <pre><code>type ClmDB = SqlProgrammabilityProvider&lt;ClmSqlProviderName, ConfigFile = AppConfigFile&gt;
  type ResultDataTable = ClmDB.dbo.Tables.ResultData
  type ResultDataTableRow = ResultDataTable.Row
  </code></pre>
  
  <p>and then I use it something like that:</p>
  
  <pre><code>let saveResultData (r : ResultData) (conn : SqlConnection) =
      let t = new ResultDataTable()
      let newRow = r.addRow t
      t.Update(conn) |&gt; ignore
      newRow.resultDataId
  </code></pre>
  
  <p>where <code>ResultData</code> is some type, which "knows" how to convert itself into a row of <code>ResultDataTable</code> (<code>ResultDataTableRow</code>). The extension <code>r.addRow t</code> does that. </p>
  
  <p>Everything is great, except that the row that I am inserting might be fairly large (25-30 MB in size) and so, I have a bad feeling that <code>t.Update(conn)</code> might randomly time out especially due to nearly 100% processor load (the computational system core is designed to consume all processing resources, though at low priority). Hovering over <code>t.Update</code> does not show any way to specify a timeout and any timeout at the level of connection is related, well, to a connection, not to the insert transaction ☹. </p>
  
  <p>So, the question is how to specify timeout for an <code>Update</code> transaction. </p>
  
  <p>Thanks a lot!</p>
  
  <p><strong>20190116</strong> update - So far <code>t.Update(conn)</code> above is holding up without timeouts on my machine while inserting 95MB data rows at 100% below normal load of some <em>other</em> stuff running there. I have not yet measured the actual time for such transactions. If I do, then I will update this.</p>