Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Failure recovery #368

Open
Thorium opened this issue Jan 10, 2017 · 0 comments
Open

Failure recovery #368

Thorium opened this issue Jan 10, 2017 · 0 comments

Comments

@Thorium
Copy link
Member

Thorium commented Jan 10, 2017

I have a (quite common scenario I suppose) web server using SQLProvider to connect a database that is located on a different server.

Sometimes the network connection does fail. That is the nature of HTTP. I try to deal with that having a retry logics when calling GetDataContext().

Now, if the web-server runs a maintenance boot (Windows update) and the network connection is not up and running when the server restarts, this is what happens:

  • Server will start, but the connection is in a broken state
  • If the connection is stored to a static variable, all the queries will crash on runtime even when the connection has been restored. Maybe because the column dictionary is empty or something.
  • This can be fixed by accessing the connection as a function, having a backing-field for the connection, and creating it again if it's null.
  • Another problem seems to be that if the server is running for long time, it seems that the primary-key dictionary goes to empty. This will cause update clauses not to work. I don't know yet the scenario and why but I think it's again about network connection breakups.

Besides that, there is more generic infrastructure, described more detailed in #238 but that started to be off-topic so I started a new issue.

Should we have some kind of extra-functions-namespace (like namespace FSharp.Data.Sql.Extensions) in SQLProvider to provide customers some tools to fight with this kind of nasty real life problems?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant