fsprojects / SQLProvider

A general F# SQL database erasing type provider, supporting LINQ queries, schema exploration, individuals, CRUD operations and much more besides.
https://fsprojects.github.io/SQLProvider
Other
580 stars 146 forks source link

Need access to CommandTimeout #446

Closed Rickasaurus closed 7 years ago

Rickasaurus commented 7 years ago

Description

We are using SQLProvider for some scripts to move around database stuff, it worked great for the first client but then we went to a bigger one and it timed out. We poked around and realized there is no way to access the CommandTimeout property on the DataContext so we're kinda stuck.

Repro steps

Please provide the steps required to reproduce the problem

  1. Step A

  2. Step B

Expected behavior

Please provide a description of the behavior you expect.

Actual behavior

Please provide a description of the actual behavior you observe.

Known workarounds

Doesn't seem to be one.

Related information

Thorium commented 7 years ago

For CRUD operations also, or just for selects? What was the default timeout? Over a minute? Are you missing a database index? ;-) CRUDs are using DTC transactions that are configured to machine.config.

pezipink commented 7 years ago

The DTC timeout is independent of the Command timeout, is it not?

Rickasaurus commented 7 years ago

We're pulling out millions of rows from databases and putting them into files for processing and experiments. This is something we do all of the time. This was the first time we tried SQLProvider as a test but we were forced to go back to the old ways.

Thorium commented 7 years ago

Great, let's add the timeout :-)

Thorium commented 7 years ago

The PR is adding optional timeout parameter to .GetDataContext(). It just sets the timeout for (non-design-time) commands inside that datacontext. I didn't test will it actually work as I didn't have anything long-running.

Rickasaurus commented 7 years ago

Awesome, thanks!