0

I want to use local realm and sync realm(Realm Object Server) in single Android Project. I want to store some data on local realm(that shouldn't be uploaded to Realm Object Server) and some data on Realm Object Server. I am creating two realm objects using two different configuration.

SyncConfiguration config = getROSRealmConfig(user);       
Realm syncRealm = Realm.getInstance(config);

RealmConfiguration config = getRealmConfig(user);      
Realm localRealm = Realm.getInstance(config);

When I storing data on Realm Object Server. It stores data on realm object server along with this It also creates schema of local realm objects on server. Though I am not storing local objects using syncRealm. How to prevent creating of schema of local realm realm object.

Phantômaxx
  • 37,901
  • 21
  • 84
  • 115
user2546410
  • 51
  • 1
  • 1
  • 5

1 Answers1

0

Why are you using local db with any configuration? Especially one with a user? As per the docs here it is stated that

That configuration—with no options—uses the Realm file default.realm located in Context.getFilesDir.

  • I can't use default.realm because I am maintaining multiple realm for each user with companyId. Here is my local Realm Configuration code. RealmConfiguration config = new RealmConfiguration.Builder() .name(companyId) .schemaVersion(34) .migration(new Migration()) .build(); return config; – user2546410 Dec 12 '17 at 05:31
  • According to the article [here](https://realm.io/docs/data-model) (under Realm URLs section), it says only users that are allowed to write will be able to write to the realm object server. I think if you change the user for your local realm to not be the exactly same (not sure how, have not used the remote one) as the remote one, it might work. – Yordan Lyubenov Dec 12 '17 at 13:29