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

Add ADO and other configuration samples to Relational Storage page in documentation #3070

Closed
dandago opened this issue May 31, 2017 · 10 comments

Comments

@dandago
Copy link

dandago commented May 31, 2017

I am attempting to use the ADO .NET Storage provider with MySQL, which according to the Storage Providers documentation should be supported.

The SiloHost is failing to start with the following exception text:

"Unable to find and/or load a candidate assembly for 'System.Data.SqlClient' invariant name."

I have tracked this to the DbConnectionFactory.cs file. Although I installed the MySql.Data package, Orleans still seems to be looking for the package needed if we were to work against SQL Server.

This might be related to the ADO .NET Invariants. For SQL Server, System.Data.SqlClient is both the name of the invariant and of the package/assembly. However this is not true for MySQL: the package/assembly is MySql.Data, whereas the invariant is MySql.Data.MySqlClient. If the connection code that looks for the assembly is working based on invariant name, this could explain why it works with SQL Server but not MySQL.

I am using Orleans 1.4.1.

@dandago
Copy link
Author

dandago commented May 31, 2017

Repro solution attached.

OrleansMySqlRepro.zip

@attilah attilah self-assigned this May 31, 2017
@attilah
Copy link
Contributor

attilah commented May 31, 2017

Hi @dandago !

Thanks for the report and the repro project.

From that what I see is that you don't need the DbProviderFactories section in the Silo's app config for Orleans itself.
On the other hand in the Silo configuration you need to specify AdoInvariant="MySql.Data.MySqlClient" within the Provider element to let Orleans know about what type of Ado.Net provider you like to use.

We've the same semantics as the System.Data supports with its own DbProviderFactories.

Please get back with the results and I will close the issue after that.

@dandago
Copy link
Author

dandago commented Jun 1, 2017

Hi @attilah,

Thank you for your response! You are right - it worked with the AdoInvariant you suggested. The DbProviderFactories entry was probably added automatically when I installed the MySql.Data package.

This AdoInvariant part needs to be better documented. I realise now that it is mentioned in the Relational Storage page, but I totally missed it. It needs to be available in the Grain Persistence page with clear examples.

Thanks again.

@veikkoeeva
Copy link
Contributor

This is true. Offering a bit of frame, in .NET Core, it looked like DbProviderFactory was going away (now doing a come-back?). In current full .NET, the configuration would be in different place from the Orleans configuration, so perhaps confusing. Then there is also the aspect one might want to load different providers for different features.

This certainly needs to be documented better.

@sergeybykov sergeybykov added this to the Triage milestone Jun 1, 2017
@attilah
Copy link
Contributor

attilah commented Jun 2, 2017

@dandago would you do an update to the documentation page and submit a PR with the suggested changes?

@attilah attilah changed the title MySQL ADO .NET Storage Provider Broken Add ADO and other configuration samples to Relational Storage page in documentation Jun 2, 2017
@attilah attilah removed the question label Jun 2, 2017
@dandago
Copy link
Author

dandago commented Jun 2, 2017

I believe this is best handled by anyone who knows the Storage Providers inside out. Aside from the issues I pointed out, there are other samples that I haven't gotten around to setting up (e.g. Posgres, and creating your own storage provider). The documentation on storage providers requires significant review that I would only be able to provide in part.

Having said that, if this can wait a little, I might find some time to experiment with storage providers a little, write a couple of blog posts for my site, and contribute the working samples for the documentation here. That might at least help a little.

By the way, the ADO .NET example refers to "Orleans.SqlUtils.StorageProvider.SqlStorageProvider", which I believe should be "AdoNetStorageProvider".

@dandago
Copy link
Author

dandago commented Jun 4, 2017

Thank you @veikkoeeva; this also sheds light on the PostgreSQL problems (#3085) which I reported yesterday, and which I have now updated accordingly.

The more I learn about Grain Persistence, the more I am developing the opinion that it should be its own section in the documentation, with different pages for each provider type, and examples in both XML and programmatic configuration for each. There would be a page on writing custom providers with an example. And the rationale (which is currently part in the Relational Storage page and part in the Grain Persistence page) would also be under this section.

@veikkoeeva
Copy link
Contributor

Should this be closed via #3100, @sergeybykov?

@sergeybykov
Copy link
Contributor

@veikkoeeva Indeed.
Fixed via #3100.

@ghost ghost locked as resolved and limited conversation to collaborators Sep 28, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

4 participants