{"action":"created","issue":{"url":"https://api.github.com/repos/realm/realm-java/issues/4379","repository_url":"https://api.github.com/repos/realm/realm-java","labels_url":"https://api.github.com/repos/realm/realm-java/issues/4379/labels{/name}","comments_url":"https://api.github.com/repos/realm/realm-java/issues/4379/comments","events_url":"https://api.github.com/repos/realm/realm-java/issues/4379/events","html_url":"https://github.com/realm/realm-java/issues/4379","id":216731591,"number":4379,"title":"Exception while deleting query results","user":{"login":"kakateeya","id":8701933,"avatar_url":"https://avatars3.githubusercontent.com/u/8701933?v=3","gravatar_id":"","url":"https://api.github.com/users/kakateeya","html_url":"https://github.com/kakateeya","followers_url":"https://api.github.com/users/kakateeya/followers","following_url":"https://api.github.com/users/kakateeya/following{/other_user}","gists_url":"https://api.github.com/users/kakateeya/gists{/gist_id}","starred_url":"https://api.github.com/users/kakateeya/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/kakateeya/subscriptions","organizations_url":"https://api.github.com/users/kakateeya/orgs","repos_url":"https://api.github.com/users/kakateeya/repos","events_url":"https://api.github.com/users/kakateeya/events{/privacy}","received_events_url":"https://api.github.com/users/kakateeya/received_events","type":"User","site_admin":false},"labels":[{"id":320044293,"url":"https://api.github.com/repos/realm/realm-java/labels/Reproduction%20Required","name":"Reproduction Required","color":"fbca04","default":false},{"id":200279932,"url":"https://api.github.com/repos/realm/realm-java/labels/S:Waiting%20For%20User","name":"S:Waiting For User","color":"ededed","default":false}],"state":"closed","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":21,"created_at":"2017-03-24T10:14:23Z","updated_at":"2017-04-24T04:29:48Z","closed_at":"2017-04-24T04:29:48Z","body":"#### Goal\r\nQuery and delete entries from Realm. I am using transaction still getting this error that I don't understand. \r\n\r\n#### Expected Results\r\n\r\nEntries deleted from Realm\r\n\r\n#### Actual Results\r\n```\r\n03-24 15:33:23.750 E/REALM_JNI(23824): jni: ThrowingException 8, Must be in a write transaction in /Users/cm/Realm/realm-java/realm/realm-library/src/main/cpp/io_realm_internal_Collection.cpp line 173, .\r\n03-24 15:33:23.750 E/REALM_JNI(23824): Exception has been thrown: Must be in a write transaction in /Users/cm/Realm/realm-java/realm/realm-library/src/main/cpp/io_realm_internal_Collection.cpp line 173\r\n```\r\n\r\n#### Steps & Code to Reproduce\r\n\r\n\r\n#### Code Sample\r\n\r\n```java\r\n\r\n        Realm realm = Realm.getInstance(realmConfig);\r\n\r\n        long currentTime = System.currentTimeMillis();\r\n        final RealmResults<RawEntry> rawEntriesToDelete = realm.where(RawEntry.class).greaterThan(ISavedEntry.FIELD_TIME, currentTime).findAll();\r\n        final RealmResults<FilteredEntry> filteredEntriesToDelete = realm.where(FilteredEntry.class).greaterThan(ISavedEntry.FIELD_TIME, currentTime).findAll();\r\n        final RealmResults<SentEntry> sentEntriesToDelete = realm.where(SentEntry.class).greaterThan(ISavedEntry.FIELD_TIME, currentTime).findAll();\r\n        realm.executeTransaction(new Realm.Transaction() {\r\n            @Override\r\n            public void execute(Realm realm) {\r\n                filteredEntriesToDelete.deleteAllFromRealm();\r\n                rawEntriesToDelete.deleteAllFromRealm();\r\n                sentEntriesToDelete.deleteAllFromRealm();\r\n            }\r\n        });\r\n\r\n        realm.close();\r\n\r\n```\r\n\r\n#### Version of Realm and tooling\r\nRealm version(s): 3.0.0\r\n\r\nRealm sync feature enabled: no\r\n\r\nAndroid Studio version: 2.2\r\n\r\nWhich Android version and device: Any"},"comment":{"url":"https://api.github.com/repos/realm/realm-java/issues/comments/296522388","html_url":"https://github.com/realm/realm-java/issues/4379#issuecomment-296522388","issue_url":"https://api.github.com/repos/realm/realm-java/issues/4379","id":296522388,"user":{"login":"beeender","id":449296,"avatar_url":"https://avatars0.githubusercontent.com/u/449296?v=3","gravatar_id":"","url":"https://api.github.com/users/beeender","html_url":"https://github.com/beeender","followers_url":"https://api.github.com/users/beeender/followers","following_url":"https://api.github.com/users/beeender/following{/other_user}","gists_url":"https://api.github.com/users/beeender/gists{/gist_id}","starred_url":"https://api.github.com/users/beeender/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/beeender/subscriptions","organizations_url":"https://api.github.com/users/beeender/orgs","repos_url":"https://api.github.com/users/beeender/repos","events_url":"https://api.github.com/users/beeender/events{/privacy}","received_events_url":"https://api.github.com/users/beeender/received_events","type":"User","site_admin":false},"created_at":"2017-04-24T04:29:48Z","updated_at":"2017-04-24T04:29:48Z","body":"@kakateeya @SamTTaylor I am closing this issue now. If you still need help on this, please let us know."}}
{"actor":{"display_login":"beeender"}}