OrleansContrib/Orleans.Providers.MongoDB

Transactional state support

tomhreb opened this issue · 5 comments

Hello,
are there any plans to add support for ITransactionalStateStorage<TModel> support?

Thanks
Tomas

Hi @tomhreb, there are no plans to support it, but we're open to PRs

I have read that there is an adapter store so that you can basically use every normal store

I have read that there is an adapter store so that you can basically use every normal store

Would you have a source of this? I know only about the paragraph below the code sample here

For development purposes, if transaction-specific storage is not available for the datastore you need, you can use an IGrainStorage implementation instead. For any transactional state that doesn't have a store configured, transactions will attempt to fail over to the grain storage using a bridge. Accessing a transactional state via a bridge to grain storage is less efficient and may not be supported in the future. Hence, the recommendation is to only use this for development purposes.

I wonder how an adapter could reliably work in a generic way.

@tomhreb the wrapper's implementation is here TransactionalStateStorageProviderWrapper.cs

And according to NamedTransactionalStateStorageFactory.cs Orleans will try and get an implementation of ITransactionalStateStorage using storageName and if not found it'll fall back to IGrainStorage implementation with the same storageName.

Yeah, that's probably what I will revert to. I've started implementing this, but it probably does not make sense.