Realm Studio Freezes


(Chris) #1

Hi,
I’m using the latest .Net Realm Database (local db).
While my application is accessing a realm object, I cannot modify it from Realm Studio. Realm Studio just freezes.
If I reopen the realm from Realm Studio, I see the value modified though.

I can’t imagine it cannot be modified while it’s being used by some applications.
I guess I’m missing something simple?

Thanks for the help.


(Chris) #2

This freeze seriously hampers the usability.
Can anyone help please?
Thanks.


(jay) #3

When asking questions, please provide your platform and versions of the applications and Realm you’re using. We would also need to have some way to reproduce the issue.

Also, more information may help as it’s unclear what this means

accessing a realm object

Creating one? Deleting one? Modifying within a write transaction?


(Chris) #4

Above.

All I did was open realm and read an object from it. While the application is still using the Realm, modifying the same object from Realm Studio will cause the freeze. I believe the reverse will also be the same.

I really hope I’m doing something wrong, otherwise, I can’t really use Realm at the current state since you can’t edit it while an application is running.

ps. I heard about thread-safe realm is in the work. Is this something that can fix the problem? My problem is not related to threads but it might carry it over to process.

Thanks.


(Nikola Irinchev) #5

If you’re using a local (non-sync) Realm, then accessing it from multiple processes should be supported. What platforms are you running this on and how do you access the Realm in Studio?


(Chris) #6

Hi, that’s good to know that I’m doing something wrong.

It’s simple.
I’m using it on PC and the latest .net version of Realm.Database, installed from the NuGet.
Here is what I did roughly.

  1. From an application, read a ReamObject, for example,

 public class DTO_Account : RealmObject
    {
        [PrimaryKey]
        public string AccountId { get; set; }

        public string Name { get; set; }
}

 public static Realm GetAccountRealm(string realmPath)
        {
            var configuration = new RealmConfiguration($"{realmPath}/Account.realm") {
                ObjectClasses = new[] {
                    typeof(DTO_Account)
                }
            };
            
            Realm realmInstance = Realm.GetInstance(configuration);
            
            realmInstance.RealmChanged += (s, e) =>
            {
                Debug.Log("Account: RealmChanged: " + s + " : " + e);
            };
            

            realmInstance.All<DTO_Account>().SubscribeForNotifications( (sender, changes, error) =>
            {
                Debug.Log("DTO_Account SubscriptionNotification: " + sender + " : " + changes + " : " + error);
            });
            
            return realmInstance;
        }

....
// assume that DTO_Account is in realm db already.
var account  = GetAccountRealm("c:/temp/test").Find<DTO_Account>(id);
  1. Then I try to change “Name” property of the DTO_Account above from Realm Studio and Realm Studio will freeze.

Please let me know what I did wrong.

Thanks.


(Nikola Irinchev) #7

Can you try removing the Realm.Database package and installing Realm instead? With Realm 4.0, we folded the Database package into the main one, so it could be an issue caused by using a very old version of Realm Core (the actual database).


(Chris) #8

Hi,
Oh, so is Realm.Database deprecated/deprecating?
Thanks.