realm-java icon indicating copy to clipboard operation
realm-java copied to clipboard

executeTransactionAsync not throwing any response (synced read only database)

Open idok595 opened this issue 9 years ago • 3 comments

after upgrade my realm version to 3.5.0 i notice that someting wrong i realized that all of my async transaction dosent work with read only database, i am using async transaction for fetching data async (the logic is not flat so it better for my to use another thread with synced querys) not to make any change, they are simply dosent work and the function not throwing any response/exception even if i am supply onError,onSuccess listeners,

i think this is mistake i realy need to perfome this stuff in transaction do to the fact that the data can be changed from remote (it is read only database with realm time sync configuration) mean while, so in order to prevent that (i am talking about 3-4 second of tranaction with many small query) i must block any write operation, even if it will not perfome any write operation.

i checked why it do to the fact that in the Realm.java line 1506 beginTransaction() called and throwing exception IllegalStateException("Write transactions cannot be used when a Realm is marked as read-only.") but this exception is ignored and not send to the onError listener,

idok595 avatar Jul 20 '17 16:07 idok595

Hello @idok595 I think you can use Asynchronous queries: https://realm.io/docs/java/latest/#asynchronous-queries

dalinaum avatar Jul 21 '17 08:07 dalinaum

this is will not help in case when it is require to join between many tables, how can i make sure that between the async queries othing will change? the only way is transaction but it is impossible to start transaction in syncred readOnlye database in the new version...

idok595 avatar Jul 23 '17 07:07 idok595

You are right. I have filed https://github.com/realm/realm-java/issues/5040 to track the bug.

bmeike avatar Jul 28 '17 20:07 bmeike