Realm 6.0 beta availability

Looking to use realm in a large ongoing project (migrating away from EF core). In order to use 5.x in its current state, we have a lot of cross-thread access to fix. 6.0 seems to potentially be resolving this issue, so I would be interested in trying it out if it is possible.

Is there a way to test out 6.0 against the .NET api?

Hi Dean,
I would expect a .NET beta release to land in Jan. But the first version won’t be exposing improvements to thread handling. We will be looking into that right after.
What exactly have been your issue? And subsequently, what would you wish for?

Sorry for the very late reply. I was unable to post on this forum for the last few weeks as all of Japan was seemingly IP blocked.

Since my post, the 6.0 announcement has surfaced and it looks to feature about exactly what we need (frozen objects). I’m still interested in the performance characteristics of this feature, and will look to be testing it as soon as a .net beta is available.

If you care to read about our journey so far migrating from ef-core to realm, I wrote it up here, including my attempted workarounds for threading issues.

Hi Dean, yeah sorry about the forum issue!
Good to hear that we are addressing the right issue! In terms of timing it appears it’s not unlikely that .Net support may slip into Feb, but it’s still a bit too early to tell.
Thanks for the reference to your journey - it’s always very interesting to see and a very good writeup!
Good luck, and let us know if you head into any issue we can help with.

I’m also struggling in an experimental project, where I try to use Realm in a Blazor Server side project. I’m running in scoped and getting a thread violation moments after creating an instance. I suspect version 6 can help me out here.

We’ve used the Nito.AsyncEx library with apps that don’t have a main thread and that has been a quite nice experience. I’ve never tried Blazor, but could be worth giving it a go while waiting for Core 6 support.

@nirinchev

Yes, I’m using AsyncContext.Run for a .NET.Core API which works nicely and fits the general architecture. It’s not that simple with Blazor so I was kind of hoping on realm 6 to save my hiney. But I suppose I can think about squeezing all things realm into a AsyncContextThread of sorts. Hmm.

Tried it. Doesn’t seem feasible. However you try to put realm code behind an AsyncContext, you still would like to use the RealmObjects in Razor components. But you can’t since these can be rendered using any thread. Thus I would have to move every RealmObject to own models, and that’s not desirable or effective.

To bad really. Blazor Server is stateful on the server pr. connection. So I was looking forward to see sessions react to data changes, tell the client via SignalR and see the SPA page change.

The only thing I can think of now, is to encapsulate the realm API behind a gRPC server, open a stream and receive changes that way. I suppose I don’t even need Realm Cloud for that :stuck_out_tongue:

You can transfer objects between threads using ThreadSafeReference. The annoying part is that if you’re doing it on background threads, you lose the reactiveness of Realm objects. And also you have to be very careful to not hold onto those for a long time, otherwise your file size will explode. But yeah, sounds like frozen objects will make that more seamless experience.

I agree. And then it will actually be a good fit for Blazor Server Apps.