Using SQL Server as Orleans Storage

I am trying to use SQL Server as a data warehouse for Orleans.

I managed to get my solution to work using Azure Local Storage Emulator, but cannot get it to work with a local instance of SQL Server. I created a database using:

https://github.com/dotnet/orleans/blob/master/src/OrleansSQLUtils/CreateOrleansTables_SqlServer.sql

and my configuration file looks like this:

http://dotnet.imtqy.com/orleans/Documentation/Advanced-Concepts/Configuring-SQL-Tables.html

This is my configuration file:

<?xml version="1.0" encoding="utf-8"?>
<OrleansConfiguration xmlns="urn:orleans">
  <Globals>
    <StorageProviders>
      <SystemStore SystemStoreType ="SqlServer"
           DeploymentId="OrleansTest"
           DataConnectionString="Data Source=.\SQL2014;Initial Catalog=Orleans;Integrated Security=True;Pooling=False;Max Pool Size=200;Asynchronous Processing=True;MultipleActiveResultSets=True" AdoInvariant="System.Data.SqlClient" />
      <Provider Type="Orleans.SqlUtils.StorageProvider.SqlStorageProvider" Name="SqlServer" />
      <!--<Provider Type="Orleans.Storage.AzureTableStorage" Name="AzureStore" DataConnectionString="UseDevelopmentStorage=true" />-->
    </StorageProviders>
    <SeedNode Address="localhost" Port="11111" />
  </Globals>
  <Defaults>
    <Networking Address="localhost" Port="11111" />
    <ProxyingGateway Address="localhost" Port="30000" />
  </Defaults>
</OrleansConfiguration>

I added the following attribute to my grains:

[StorageProvider(ProviderName = "SqlServer")]

Then I get the following error: Could not locate a state map factory type...

, , , - ? -, StateMapFactoryType SQL?

+4
1

-, <SystemStore> StorageProvider. node Oracle. :

<OrleansConfiguration xmlns="urn:orleans">
  <Globals>
    <SystemStore SystemStoreType ="SqlServer"
       DeploymentId="OrleansTest"
       DataConnectionString="Data Source=.\SQL2014;Initial Catalog=Orleans;Integrated Security=True;Pooling=False;Max Pool Size=200;Asynchronous Processing=True;MultipleActiveResultSets=True" AdoInvariant="System.Data.SqlClient" />        
  </Globals>
  <Defaults>
    <Networking Address="" Port="11111" />
    <ProxyingGateway Address="" Port="30000" />
  </Defaults>
</OrleansConfiguration>

StorageProvider

<OrleansConfiguration xmlns="urn:orleans">
  <Globals>

<StorageProviders>
  <Provider Type="Orleans.SqlUtils.StorageProvider.SqlStorageProvider" Name="SqlServer" />
</StorageProviders>


    <SystemStore SystemStoreType ="SqlServer"
       DeploymentId="OrleansTest"
       DataConnectionString="Data Source=.\SQL2014;Initial Catalog=Orleans;Integrated Security=True;Pooling=False;Max Pool Size=200;Asynchronous Processing=True;MultipleActiveResultSets=True" AdoInvariant="System.Data.SqlClient" />        
  </Globals>
  <Defaults>
    <Networking Address="" Port="11111" />
    <ProxyingGateway Address="" Port="30000" />
  </Defaults>
</OrleansConfiguration>

. Orleans.SqlUtils.StorageProvider.SqlStorageProvider

ElasticClient P & P, (, )

( ( , , , , : D) https://github.com/OrleansContrib/Orleans.StorageProviders.SimpleSQLServerStorage

ok, Orleans.SqlUtils.StorageProvider.SqlStorageProvider :

  • ConnectionString
  • MapName
  • StateMapFactoryType

<Provider Type="Orleans.SqlUtils.StorageProvider.SqlStorageProvider" Name="guts"  ConnectionString = "Server=.;Initial catalog=guts;Integrated Security=SSPI;" MapName="guts" StateMapFactoryType="ClassName, assemblyname" />

StateMapFactory Orleans.SqlUtils.StorageProvider.IGrainStateMapFactory https://github.com/dotnet/orleans/blob/v1.1.3/src/OrleansSQLUtils/Storage/Provider/IGrainStateMapFactory.cs

https://github.com/dotnet/orleans/blob/v1.1.3/src/TesterInternal/StorageTests/SQLAdapter/SampleGrainStateMapFactory.cs

! , 1.1.3 Orleans.SqlUtils.StorageProvider.IGrainStateMapFactory, , github.

+3

All Articles