Giter VIP home page Giter VIP logo

orleans.storageprovider.documentdb's Introduction

DocumentDB storage provider for Orleans

This is a StorageProvider for DocumentDB for the Microsoft Research Project Orleans. The storage provider allows to persist stateful grains into DocumentDB.

In order to use the provider you need to add the following provider to your configuration:

<Provider Type="Orleans.StorageProvider.DocumentDB.DocumentDBStorageProvider" Name="DocumentDBStore" Url="https://<account>.documents.azure.com:443/" Key="<key>" />

and this line to any grain that uses it

[StorageProvider(ProviderName = "DocumentDBStore")]

You can obtain the Url and Key from Keys blade in Azure Portal's DocumentDB Account.

orleans.storageprovider.documentdb's People

Contributors

jkonecki avatar richorama avatar

Stargazers

 avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

orleans.storageprovider.documentdb's Issues

Cannot read state after grain deactivation

Hi,

I have included the project Orleans.StorageProvider.DocumentDB in my solution because I am interesting in using this provider. I had to make a small modification on the code to make it build with the release 1.0.10 of Orleans, because it does not include the interface IGrainState anymore. Thus, I changed the references of IGrainState to GrainState.

I am running a scenario where I explicitly deactivate a grain and I activate it again on the next message. When doing that I get an error on line 60 of DocumentDBStorageProvider.cs, which reads:

grainState.SetAll(document.State);

The exception that is thrown is:

{"Object of type 'System.Int64' cannot be converted to type 'System.Int32'."}

The state of my grain includes just an integer:

public class ProcessorState : GrainState {
public int Number { get; set; }
}

The exception is thrown after deactivation has completed and I am sending a new message to the grain expecting it to read the state from DocumentDB and activate again.

I am using DocumentDB client 1.3.0, Orleans 1.0.10 and Newtonsoft.Json 6.0.4.

Thanks.

DocumentDb storage provider swallows exceptions (also InconsistentState)

While quickly glancing through Azure/azure-cosmos-dotnet-v2#77, noticed the exceptions are swallowed.

The semantics tell InconsistentStateException should thrown upon version violation. Apart of it being mandatory, I believe all exceptions that result in failure in operations should be propagated so the runtime can take appropriate action (some reference at dotnet/orleans#1902, I don't remember the actual issue that started this).

In addition to exceptions being swallowed, it might be worth noting the error codes don't align with the other providers.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.