OrleansContrib / Orleans.Providers.MongoDB

A MongoDb implementation of the Orleans Providers: Membership, Storage and Reminders.
MIT License
100 stars 43 forks source link

Transactional state support #121

Closed tomhreb closed 1 year ago

tomhreb commented 1 year ago

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

Thanks Tomas

wassim-k commented 1 year ago

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

SebastianStehle commented 1 year ago

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

tomhreb commented 1 year ago

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.

wassim-k commented 1 year ago

@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.

tomhreb commented 1 year ago

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