GitHub PullRequestReviewCommentEvent at 2014-10-23 13:05:47
Repository: realm-java
Actor: bmunkholm
Payload: {"action":"created","comment":{"url":"https://api.github.com/repos/realm/realm-java/pulls/comments/19275353","id":19275353,"diff_hunk":"@@ -49,6 +49,15 @@ public void endRead() {\n         parent.endRead();\n     }\n \n+    public void rollback() {\n+        if (!immutable) {\n+            parent.rollbackAndContinueAsRead();\n+            immutable = true;\n+        } else {\n+            throw new RealmException(\"Cannot cancel a non-write transaction.\");","path":"realm/src/main/java/io/realm/internal/ImplicitTransaction.java","position":9,"original_position":9,"commit_id":"95375dc5e42e54a434fef1deca2f72f2159e538d","original_commit_id":"95375dc5e42e54a434fef1deca2f72f2159e538d","user":{"login":"bmunkholm","id":1215687,"avatar_url":"https://avatars.githubusercontent.com/u/1215687?v=2","gravatar_id":"","url":"https://api.github.com/users/bmunkholm","html_url":"https://github.com/bmunkholm","followers_url":"https://api.github.com/users/bmunkholm/followers","following_url":"https://api.github.com/users/bmunkholm/following{/other_user}","gists_url":"https://api.github.com/users/bmunkholm/gists{/gist_id}","starred_url":"https://api.github.com/users/bmunkholm/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/bmunkholm/subscriptions","organizations_url":"https://api.github.com/users/bmunkholm/orgs","repos_url":"https://api.github.com/users/bmunkholm/repos","events_url":"https://api.github.com/users/bmunkholm/events{/privacy}","received_events_url":"https://api.github.com/users/bmunkholm/received_events","type":"User","site_admin":false},"body":"Consider to use IllegalStateException instead. Also in the ```promoteToWrite```method. (and remember to edit the documentation for the methods calling this.","created_at":"2014-10-23T13:05:47Z","updated_at":"2014-10-23T13:05:47Z","html_url":"https://github.com/realm/realm-java/pull/499#discussion_r19275353","pull_request_url":"https://api.github.com/repos/realm/realm-java/pulls/499","_links":{"self":{"href":"https://api.github.com/repos/realm/realm-java/pulls/comments/19275353"},"html":{"href":"https://github.com/realm/realm-java/pull/499#discussion_r19275353"},"pull_request":{"href":"https://api.github.com/repos/realm/realm-java/pulls/499"}}},"pull_request":{"url":"https://api.github.com/repos/realm/realm-java/pulls/499","id":23220844,"html_url":"https://github.com/realm/realm-java/pull/499","diff_url":"https://github.com/realm/realm-java/pull/499.diff","patch_url":"https://github.com/realm/realm-java/pull/499.patch","issue_url":"https://api.github.com/repos/realm/realm-java/issues/499","number":499,"state":"open","locked":false,"title":"Implementation of Realm.cancelTransaction","user":{"login":"kneth","id":1225363,"avatar_url":"https://avatars.githubusercontent.com/u/1225363?v=2","gravatar_id":"","url":"https://api.github.com/users/kneth","html_url":"https://github.com/kneth","followers_url":"https://api.github.com/users/kneth/followers","following_url":"https://api.github.com/users/kneth/following{/other_user}","gists_url":"https://api.github.com/users/kneth/gists{/gist_id}","starred_url":"https://api.github.com/users/kneth/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/kneth/subscriptions","organizations_url":"https://api.github.com/users/kneth/orgs","repos_url":"https://api.github.com/users/kneth/repos","events_url":"https://api.github.com/users/kneth/events{/privacy}","received_events_url":"https://api.github.com/users/kneth/received_events","type":"User","site_admin":false},"body":"It can be very useful to be able to cancel/abort a write transaction. This is a simple implementation of `Realm.cancelTransaction()`.\r\n\r\n@bmunkholm @emanuelez ","created_at":"2014-10-23T11:08:54Z","updated_at":"2014-10-23T13:05:47Z","closed_at":null,"merged_at":null,"merge_commit_sha":"d9469a575abf40577e8486b5286da5f6f0c0c0ad","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/realm/realm-java/pulls/499/commits","review_comments_url":"https://api.github.com/repos/realm/realm-java/pulls/499/comments","review_comment_url":"https://api.github.com/repos/realm/realm-java/pulls/comments/{number}","comments_url":"https://api.github.com/repos/realm/realm-java/issues/499/comments","statuses_url":"https://api.github.com/repos/realm/realm-java/statuses/95375dc5e42e54a434fef1deca2f72f2159e538d","head":{"label":"realm:kg-rollback","ref":"kg-rollback","sha":"95375dc5e42e54a434fef1deca2f72f2159e538d","user":{"login":"realm","id":7575099,"avatar_url":"https://avatars.githubusercontent.com/u/7575099?v=2","gravatar_id":"","url":"https://api.github.com/users/realm","html_url":"https://github.com/realm","followers_url":"https://api.github.com/users/realm/followers","following_url":"https://api.github.com/users/realm/following{/other_user}","gists_url":"https://api.github.com/users/realm/gists{/gist_id}","starred_url":"https://api.github.com/users/realm/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/realm/subscriptions","organizations_url":"https://api.github.com/users/realm/orgs","repos_url":"https://api.github.com/users/realm/repos","events_url":"https://api.github.com/users/realm/events{/privacy}","received_events_url":"https://api.github.com/users/realm/received_events","type":"Organization","site_admin":false},"repo":{"id":4084908,"name":"realm-java","full_name":"realm/realm-java","owner":{"login":"realm","id":7575099,"avatar_url":"https://avatars.githubusercontent.com/u/7575099?v=2","gravatar_id":"","url":"https://api.github.com/users/realm","html_url":"https://github.com/realm","followers_url":"https://api.github.com/users/realm/followers","following_url":"https://api.github.com/users/realm/following{/other_user}","gists_url":"https://api.github.com/users/realm/gists{/gist_id}","starred_url":"https://api.github.com/users/realm/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/realm/subscriptions","organizations_url":"https://api.github.com/users/realm/orgs","repos_url":"https://api.github.com/users/realm/repos","events_url":"https://api.github.com/users/realm/events{/privacy}","received_events_url":"https://api.github.com/users/realm/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/realm/realm-java","description":"Realm is a mobile database: a replacement for SQLite & ORMs","fork":false,"url":"https://api.github.com/repos/realm/realm-java","forks_url":"https://api.github.com/repos/realm/realm-java/forks","keys_url":"https://api.github.com/repos/realm/realm-java/keys{/key_id}","collaborators_url":"https://api.github.com/repos/realm/realm-java/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/realm/realm-java/teams","hooks_url":"https://api.github.com/repos/realm/realm-java/hooks","issue_events_url":"https://api.github.com/repos/realm/realm-java/issues/events{/number}","events_url":"https://api.github.com/repos/realm/realm-java/events","assignees_url":"https://api.github.com/repos/realm/realm-java/assignees{/user}","branches_url":"https://api.github.com/repos/realm/realm-java/branches{/branch}","tags_url":"https://api.github.com/repos/realm/realm-java/tags","blobs_url":"https://api.github.com/repos/realm/realm-java/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/realm/realm-java/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/realm/realm-java/git/refs{/sha}","trees_url":"https://api.github.com/repos/realm/realm-java/git/trees{/sha}","statuses_url":"https://api.github.com/repos/realm/realm-java/statuses/{sha}","languages_url":"https://api.github.com/repos/realm/realm-java/languages","stargazers_url":"https://api.github.com/repos/realm/realm-java/stargazers","contributors_url":"https://api.github.com/repos/realm/realm-java/contributors","subscribers_url":"https://api.github.com/repos/realm/realm-java/subscribers","subscription_url":"https://api.github.com/repos/realm/realm-java/subscription","commits_url":"https://api.github.com/repos/realm/realm-java/commits{/sha}","git_commits_url":"https://api.github.com/repos/realm/realm-java/git/commits{/sha}","comments_url":"https://api.github.com/repos/realm/realm-java/comments{/number}","issue_comment_url":"https://api.github.com/repos/realm/realm-java/issues/comments/{number}","contents_url":"https://api.github.com/repos/realm/realm-java/contents/{+path}","compare_url":"https://api.github.com/repos/realm/realm-java/compare/{base}...{head}","merges_url":"https://api.github.com/repos/realm/realm-java/merges","archive_url":"https://api.github.com/repos/realm/realm-java/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/realm/realm-java/downloads","issues_url":"https://api.github.com/repos/realm/realm-java/issues{/number}","pulls_url":"https://api.github.com/repos/realm/realm-java/pulls{/number}","milestones_url":"https://api.github.com/repos/realm/realm-java/milestones{/number}","notifications_url":"https://api.github.com/repos/realm/realm-java/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/realm/realm-java/labels{/name}","releases_url":"https://api.github.com/repos/realm/realm-java/releases{/id}","created_at":"2012-04-20T09:18:42Z","updated_at":"2014-10-23T12:59:57Z","pushed_at":"2014-10-23T11:18:18Z","git_url":"git://github.com/realm/realm-java.git","ssh_url":"git@github.com:realm/realm-java.git","clone_url":"https://github.com/realm/realm-java.git","svn_url":"https://github.com/realm/realm-java","homepage":"http://realm.io","size":43867,"stargazers_count":667,"watchers_count":667,"language":"Java","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":37,"mirror_url":null,"open_issues_count":23,"forks":37,"open_issues":23,"watchers":667,"default_branch":"master"}},"base":{"label":"realm:master","ref":"master","sha":"39d00a9e751fe353823449020bf28ac4bd25da0d","user":{"login":"realm","id":7575099,"avatar_url":"https://avatars.githubusercontent.com/u/7575099?v=2","gravatar_id":"","url":"https://api.github.com/users/realm","html_url":"https://github.com/realm","followers_url":"https://api.github.com/users/realm/followers","following_url":"https://api.github.com/users/realm/following{/other_user}","gists_url":"https://api.github.com/users/realm/gists{/gist_id}","starred_url":"https://api.github.com/users/realm/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/realm/subscriptions","organizations_url":"https://api.github.com/users/realm/orgs","repos_url":"https://api.github.com/users/realm/repos","events_url":"https://api.github.com/users/realm/events{/privacy}","received_events_url":"https://api.github.com/users/realm/received_events","type":"Organization","site_admin":false},"repo":{"id":4084908,"name":"realm-java","full_name":"realm/realm-java","owner":{"login":"realm","id":7575099,"avatar_url":"https://avatars.githubusercontent.com/u/7575099?v=2","gravatar_id":"","url":"https://api.github.com/users/realm","html_url":"https://github.com/realm","followers_url":"https://api.github.com/users/realm/followers","following_url":"https://api.github.com/users/realm/following{/other_user}","gists_url":"https://api.github.com/users/realm/gists{/gist_id}","starred_url":"https://api.github.com/users/realm/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/realm/subscriptions","organizations_url":"https://api.github.com/users/realm/orgs","repos_url":"https://api.github.com/users/realm/repos","events_url":"https://api.github.com/users/realm/events{/privacy}","received_events_url":"https://api.github.com/users/realm/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/realm/realm-java","description":"Realm is a mobile database: a replacement for SQLite & ORMs","fork":false,"url":"https://api.github.com/repos/realm/realm-java","forks_url":"https://api.github.com/repos/realm/realm-java/forks","keys_url":"https://api.github.com/repos/realm/realm-java/keys{/key_id}","collaborators_url":"https://api.github.com/repos/realm/realm-java/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/realm/realm-java/teams","hooks_url":"https://api.github.com/repos/realm/realm-java/hooks","issue_events_url":"https://api.github.com/repos/realm/realm-java/issues/events{/number}","events_url":"https://api.github.com/repos/realm/realm-java/events","assignees_url":"https://api.github.com/repos/realm/realm-java/assignees{/user}","branches_url":"https://api.github.com/repos/realm/realm-java/branches{/branch}","tags_url":"https://api.github.com/repos/realm/realm-java/tags","blobs_url":"https://api.github.com/repos/realm/realm-java/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/realm/realm-java/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/realm/realm-java/git/refs{/sha}","trees_url":"https://api.github.com/repos/realm/realm-java/git/trees{/sha}","statuses_url":"https://api.github.com/repos/realm/realm-java/statuses/{sha}","languages_url":"https://api.github.com/repos/realm/realm-java/languages","stargazers_url":"https://api.github.com/repos/realm/realm-java/stargazers","contributors_url":"https://api.github.com/repos/realm/realm-java/contributors","subscribers_url":"https://api.github.com/repos/realm/realm-java/subscribers","subscription_url":"https://api.github.com/repos/realm/realm-java/subscription","commits_url":"https://api.github.com/repos/realm/realm-java/commits{/sha}","git_commits_url":"https://api.github.com/repos/realm/realm-java/git/commits{/sha}","comments_url":"https://api.github.com/repos/realm/realm-java/comments{/number}","issue_comment_url":"https://api.github.com/repos/realm/realm-java/issues/comments/{number}","contents_url":"https://api.github.com/repos/realm/realm-java/contents/{+path}","compare_url":"https://api.github.com/repos/realm/realm-java/compare/{base}...{head}","merges_url":"https://api.github.com/repos/realm/realm-java/merges","archive_url":"https://api.github.com/repos/realm/realm-java/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/realm/realm-java/downloads","issues_url":"https://api.github.com/repos/realm/realm-java/issues{/number}","pulls_url":"https://api.github.com/repos/realm/realm-java/pulls{/number}","milestones_url":"https://api.github.com/repos/realm/realm-java/milestones{/number}","notifications_url":"https://api.github.com/repos/realm/realm-java/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/realm/realm-java/labels{/name}","releases_url":"https://api.github.com/repos/realm/realm-java/releases{/id}","created_at":"2012-04-20T09:18:42Z","updated_at":"2014-10-23T12:59:57Z","pushed_at":"2014-10-23T11:18:18Z","git_url":"git://github.com/realm/realm-java.git","ssh_url":"git@github.com:realm/realm-java.git","clone_url":"https://github.com/realm/realm-java.git","svn_url":"https://github.com/realm/realm-java","homepage":"http://realm.io","size":43867,"stargazers_count":667,"watchers_count":667,"language":"Java","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":37,"mirror_url":null,"open_issues_count":23,"forks":37,"open_issues":23,"watchers":667,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/realm/realm-java/pulls/499"},"html":{"href":"https://github.com/realm/realm-java/pull/499"},"issue":{"href":"https://api.github.com/repos/realm/realm-java/issues/499"},"comments":{"href":"https://api.github.com/repos/realm/realm-java/issues/499/comments"},"review_comments":{"href":"https://api.github.com/repos/realm/realm-java/pulls/499/comments"},"review_comment":{"href":"https://api.github.com/repos/realm/realm-java/pulls/comments/{number}"},"commits":{"href":"https://api.github.com/repos/realm/realm-java/pulls/499/commits"},"statuses":{"href":"https://api.github.com/repos/realm/realm-java/statuses/95375dc5e42e54a434fef1deca2f72f2159e538d"}}}}