{"action":"created","comment":{"url":"https://api.github.com/repos/roma-turkin/javafiddle/pulls/comments/59989887","id":59989887,"diff_hunk":"@@ -8,169 +17,189 @@\n import java.util.LinkedList;\n import java.util.Map;\n import java.util.HashMap;\n+import java.util.logging.Level;\n+import java.util.logging.Logger;\n \n-import ru.javafiddle.jpa.entity.Access;\n-import ru.javafiddle.jpa.entity.UserGroup;\n-import ru.javafiddle.jpa.entity.Group;\n-import ru.javafiddle.jpa.entity.User;\n \n \n-@Stateless\n \n+@Stateless\n public class GroupBean {\n \n-    @PersistenceContext\n+    @EJB\n+    private UserGroupBean userGroup;\n+\n+    private static final Logger logger =\n+            Logger.getLogger(ProjectBean.class.getName());\n+\n+    @PersistenceContext(name = \"JFPersistenceUnit\")\n     EntityManager em;\n \n     public GroupBean() {\n+\n     }\n \n-    //we should get at first userId, then add this element to UserGroups\n-    //when we are in this method we definitly have group with such id\n-    public void addMember(int groupId, String userNickName, String accessRights) {\n-\n-        //check if this group exists\n-       /* Group group;\n-        if (groupId == 0) {\n-            group = new Group();\n-            group.setGroupName(\"default\");//still it is not clear about group names\n-            em.persist(group);\n-        }*/\n-        User user = getUser(userNickName);\n-        Access access = getAccess(accessRights);\n+    //we always know that the group were we are trying to add a user exits now\n+    //CALL THIS METHOD WHEN THE PERSON IS CREATING A GROUP BY HIMSELF!!\n+    @TransactionAttribute(TransactionAttributeType.REQUIRES_NEW)","path":"JavaFiddle-ejb/src/main/java/ru/javafiddle/core/ejb/GroupBean.java","position":62,"original_position":62,"commit_id":"d9efe0c42b1ecf174a709400ed43661476b30e52","original_commit_id":"d9efe0c42b1ecf174a709400ed43661476b30e52","user":{"login":"alexander1leonov","id":15158069,"avatar_url":"https://avatars.githubusercontent.com/u/15158069?v=3","gravatar_id":"","url":"https://api.github.com/users/alexander1leonov","html_url":"https://github.com/alexander1leonov","followers_url":"https://api.github.com/users/alexander1leonov/followers","following_url":"https://api.github.com/users/alexander1leonov/following{/other_user}","gists_url":"https://api.github.com/users/alexander1leonov/gists{/gist_id}","starred_url":"https://api.github.com/users/alexander1leonov/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/alexander1leonov/subscriptions","organizations_url":"https://api.github.com/users/alexander1leonov/orgs","repos_url":"https://api.github.com/users/alexander1leonov/repos","events_url":"https://api.github.com/users/alexander1leonov/events{/privacy}","received_events_url":"https://api.github.com/users/alexander1leonov/received_events","type":"User","site_admin":false},"body":"REQUIRES_NEW is a dangerous thing, very rarely necessary. Please see my comment regarding to that.","created_at":"2016-04-17T18:36:48Z","updated_at":"2016-04-17T18:36:48Z","html_url":"https://github.com/roma-turkin/javafiddle/pull/34#discussion_r59989887","pull_request_url":"https://api.github.com/repos/roma-turkin/javafiddle/pulls/34","_links":{"self":{"href":"https://api.github.com/repos/roma-turkin/javafiddle/pulls/comments/59989887"},"html":{"href":"https://github.com/roma-turkin/javafiddle/pull/34#discussion_r59989887"},"pull_request":{"href":"https://api.github.com/repos/roma-turkin/javafiddle/pulls/34"}}},"pull_request":{"url":"https://api.github.com/repos/roma-turkin/javafiddle/pulls/34","id":66555277,"html_url":"https://github.com/roma-turkin/javafiddle/pull/34","diff_url":"https://github.com/roma-turkin/javafiddle/pull/34.diff","patch_url":"https://github.com/roma-turkin/javafiddle/pull/34.patch","issue_url":"https://api.github.com/repos/roma-turkin/javafiddle/issues/34","number":34,"state":"open","locked":false,"title":"Projectbean branch","user":{"login":"Atsanda","id":8836917,"avatar_url":"https://avatars.githubusercontent.com/u/8836917?v=3","gravatar_id":"","url":"https://api.github.com/users/Atsanda","html_url":"https://github.com/Atsanda","followers_url":"https://api.github.com/users/Atsanda/followers","following_url":"https://api.github.com/users/Atsanda/following{/other_user}","gists_url":"https://api.github.com/users/Atsanda/gists{/gist_id}","starred_url":"https://api.github.com/users/Atsanda/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Atsanda/subscriptions","organizations_url":"https://api.github.com/users/Atsanda/orgs","repos_url":"https://api.github.com/users/Atsanda/repos","events_url":"https://api.github.com/users/Atsanda/events{/privacy}","received_events_url":"https://api.github.com/users/Atsanda/received_events","type":"User","site_admin":false},"body":"","created_at":"2016-04-14T21:16:18Z","updated_at":"2016-04-17T18:36:48Z","closed_at":null,"merged_at":null,"merge_commit_sha":"3135b560f01d670f033aea18aa450a84897cd21b","assignee":{"login":"alexander1leonov","id":15158069,"avatar_url":"https://avatars.githubusercontent.com/u/15158069?v=3","gravatar_id":"","url":"https://api.github.com/users/alexander1leonov","html_url":"https://github.com/alexander1leonov","followers_url":"https://api.github.com/users/alexander1leonov/followers","following_url":"https://api.github.com/users/alexander1leonov/following{/other_user}","gists_url":"https://api.github.com/users/alexander1leonov/gists{/gist_id}","starred_url":"https://api.github.com/users/alexander1leonov/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/alexander1leonov/subscriptions","organizations_url":"https://api.github.com/users/alexander1leonov/orgs","repos_url":"https://api.github.com/users/alexander1leonov/repos","events_url":"https://api.github.com/users/alexander1leonov/events{/privacy}","received_events_url":"https://api.github.com/users/alexander1leonov/received_events","type":"User","site_admin":false},"milestone":null,"commits_url":"https://api.github.com/repos/roma-turkin/javafiddle/pulls/34/commits","review_comments_url":"https://api.github.com/repos/roma-turkin/javafiddle/pulls/34/comments","review_comment_url":"https://api.github.com/repos/roma-turkin/javafiddle/pulls/comments{/number}","comments_url":"https://api.github.com/repos/roma-turkin/javafiddle/issues/34/comments","statuses_url":"https://api.github.com/repos/roma-turkin/javafiddle/statuses/d9efe0c42b1ecf174a709400ed43661476b30e52","head":{"label":"roma-turkin:projectbean_branch","ref":"projectbean_branch","sha":"d9efe0c42b1ecf174a709400ed43661476b30e52","user":{"login":"roma-turkin","id":3299157,"avatar_url":"https://avatars.githubusercontent.com/u/3299157?v=3","gravatar_id":"","url":"https://api.github.com/users/roma-turkin","html_url":"https://github.com/roma-turkin","followers_url":"https://api.github.com/users/roma-turkin/followers","following_url":"https://api.github.com/users/roma-turkin/following{/other_user}","gists_url":"https://api.github.com/users/roma-turkin/gists{/gist_id}","starred_url":"https://api.github.com/users/roma-turkin/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/roma-turkin/subscriptions","organizations_url":"https://api.github.com/users/roma-turkin/orgs","repos_url":"https://api.github.com/users/roma-turkin/repos","events_url":"https://api.github.com/users/roma-turkin/events{/privacy}","received_events_url":"https://api.github.com/users/roma-turkin/received_events","type":"User","site_admin":false},"repo":{"id":44048656,"name":"javafiddle","full_name":"roma-turkin/javafiddle","owner":{"login":"roma-turkin","id":3299157,"avatar_url":"https://avatars.githubusercontent.com/u/3299157?v=3","gravatar_id":"","url":"https://api.github.com/users/roma-turkin","html_url":"https://github.com/roma-turkin","followers_url":"https://api.github.com/users/roma-turkin/followers","following_url":"https://api.github.com/users/roma-turkin/following{/other_user}","gists_url":"https://api.github.com/users/roma-turkin/gists{/gist_id}","starred_url":"https://api.github.com/users/roma-turkin/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/roma-turkin/subscriptions","organizations_url":"https://api.github.com/users/roma-turkin/orgs","repos_url":"https://api.github.com/users/roma-turkin/repos","events_url":"https://api.github.com/users/roma-turkin/events{/privacy}","received_events_url":"https://api.github.com/users/roma-turkin/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/roma-turkin/javafiddle","description":"SImple Web-based Java IDE.","fork":false,"url":"https://api.github.com/repos/roma-turkin/javafiddle","forks_url":"https://api.github.com/repos/roma-turkin/javafiddle/forks","keys_url":"https://api.github.com/repos/roma-turkin/javafiddle/keys{/key_id}","collaborators_url":"https://api.github.com/repos/roma-turkin/javafiddle/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/roma-turkin/javafiddle/teams","hooks_url":"https://api.github.com/repos/roma-turkin/javafiddle/hooks","issue_events_url":"https://api.github.com/repos/roma-turkin/javafiddle/issues/events{/number}","events_url":"https://api.github.com/repos/roma-turkin/javafiddle/events","assignees_url":"https://api.github.com/repos/roma-turkin/javafiddle/assignees{/user}","branches_url":"https://api.github.com/repos/roma-turkin/javafiddle/branches{/branch}","tags_url":"https://api.github.com/repos/roma-turkin/javafiddle/tags","blobs_url":"https://api.github.com/repos/roma-turkin/javafiddle/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/roma-turkin/javafiddle/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/roma-turkin/javafiddle/git/refs{/sha}","trees_url":"https://api.github.com/repos/roma-turkin/javafiddle/git/trees{/sha}","statuses_url":"https://api.github.com/repos/roma-turkin/javafiddle/statuses/{sha}","languages_url":"https://api.github.com/repos/roma-turkin/javafiddle/languages","stargazers_url":"https://api.github.com/repos/roma-turkin/javafiddle/stargazers","contributors_url":"https://api.github.com/repos/roma-turkin/javafiddle/contributors","subscribers_url":"https://api.github.com/repos/roma-turkin/javafiddle/subscribers","subscription_url":"https://api.github.com/repos/roma-turkin/javafiddle/subscription","commits_url":"https://api.github.com/repos/roma-turkin/javafiddle/commits{/sha}","git_commits_url":"https://api.github.com/repos/roma-turkin/javafiddle/git/commits{/sha}","comments_url":"https://api.github.com/repos/roma-turkin/javafiddle/comments{/number}","issue_comment_url":"https://api.github.com/repos/roma-turkin/javafiddle/issues/comments{/number}","contents_url":"https://api.github.com/repos/roma-turkin/javafiddle/contents/{+path}","compare_url":"https://api.github.com/repos/roma-turkin/javafiddle/compare/{base}...{head}","merges_url":"https://api.github.com/repos/roma-turkin/javafiddle/merges","archive_url":"https://api.github.com/repos/roma-turkin/javafiddle/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/roma-turkin/javafiddle/downloads","issues_url":"https://api.github.com/repos/roma-turkin/javafiddle/issues{/number}","pulls_url":"https://api.github.com/repos/roma-turkin/javafiddle/pulls{/number}","milestones_url":"https://api.github.com/repos/roma-turkin/javafiddle/milestones{/number}","notifications_url":"https://api.github.com/repos/roma-turkin/javafiddle/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/roma-turkin/javafiddle/labels{/name}","releases_url":"https://api.github.com/repos/roma-turkin/javafiddle/releases{/id}","deployments_url":"https://api.github.com/repos/roma-turkin/javafiddle/deployments","created_at":"2015-10-11T10:57:50Z","updated_at":"2016-02-04T11:25:09Z","pushed_at":"2016-04-17T10:50:48Z","git_url":"git://github.com/roma-turkin/javafiddle.git","ssh_url":"git@github.com:roma-turkin/javafiddle.git","clone_url":"https://github.com/roma-turkin/javafiddle.git","svn_url":"https://github.com/roma-turkin/javafiddle","homepage":null,"size":6425,"stargazers_count":0,"watchers_count":0,"language":"JavaScript","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":2,"mirror_url":null,"open_issues_count":15,"forks":2,"open_issues":15,"watchers":0,"default_branch":"master"}},"base":{"label":"roma-turkin:development","ref":"development","sha":"b929d08029a900465744cb4ec51cfde78b1ff237","user":{"login":"roma-turkin","id":3299157,"avatar_url":"https://avatars.githubusercontent.com/u/3299157?v=3","gravatar_id":"","url":"https://api.github.com/users/roma-turkin","html_url":"https://github.com/roma-turkin","followers_url":"https://api.github.com/users/roma-turkin/followers","following_url":"https://api.github.com/users/roma-turkin/following{/other_user}","gists_url":"https://api.github.com/users/roma-turkin/gists{/gist_id}","starred_url":"https://api.github.com/users/roma-turkin/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/roma-turkin/subscriptions","organizations_url":"https://api.github.com/users/roma-turkin/orgs","repos_url":"https://api.github.com/users/roma-turkin/repos","events_url":"https://api.github.com/users/roma-turkin/events{/privacy}","received_events_url":"https://api.github.com/users/roma-turkin/received_events","type":"User","site_admin":false},"repo":{"id":44048656,"name":"javafiddle","full_name":"roma-turkin/javafiddle","owner":{"login":"roma-turkin","id":3299157,"avatar_url":"https://avatars.githubusercontent.com/u/3299157?v=3","gravatar_id":"","url":"https://api.github.com/users/roma-turkin","html_url":"https://github.com/roma-turkin","followers_url":"https://api.github.com/users/roma-turkin/followers","following_url":"https://api.github.com/users/roma-turkin/following{/other_user}","gists_url":"https://api.github.com/users/roma-turkin/gists{/gist_id}","starred_url":"https://api.github.com/users/roma-turkin/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/roma-turkin/subscriptions","organizations_url":"https://api.github.com/users/roma-turkin/orgs","repos_url":"https://api.github.com/users/roma-turkin/repos","events_url":"https://api.github.com/users/roma-turkin/events{/privacy}","received_events_url":"https://api.github.com/users/roma-turkin/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/roma-turkin/javafiddle","description":"SImple Web-based Java IDE.","fork":false,"url":"https://api.github.com/repos/roma-turkin/javafiddle","forks_url":"https://api.github.com/repos/roma-turkin/javafiddle/forks","keys_url":"https://api.github.com/repos/roma-turkin/javafiddle/keys{/key_id}","collaborators_url":"https://api.github.com/repos/roma-turkin/javafiddle/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/roma-turkin/javafiddle/teams","hooks_url":"https://api.github.com/repos/roma-turkin/javafiddle/hooks","issue_events_url":"https://api.github.com/repos/roma-turkin/javafiddle/issues/events{/number}","events_url":"https://api.github.com/repos/roma-turkin/javafiddle/events","assignees_url":"https://api.github.com/repos/roma-turkin/javafiddle/assignees{/user}","branches_url":"https://api.github.com/repos/roma-turkin/javafiddle/branches{/branch}","tags_url":"https://api.github.com/repos/roma-turkin/javafiddle/tags","blobs_url":"https://api.github.com/repos/roma-turkin/javafiddle/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/roma-turkin/javafiddle/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/roma-turkin/javafiddle/git/refs{/sha}","trees_url":"https://api.github.com/repos/roma-turkin/javafiddle/git/trees{/sha}","statuses_url":"https://api.github.com/repos/roma-turkin/javafiddle/statuses/{sha}","languages_url":"https://api.github.com/repos/roma-turkin/javafiddle/languages","stargazers_url":"https://api.github.com/repos/roma-turkin/javafiddle/stargazers","contributors_url":"https://api.github.com/repos/roma-turkin/javafiddle/contributors","subscribers_url":"https://api.github.com/repos/roma-turkin/javafiddle/subscribers","subscription_url":"https://api.github.com/repos/roma-turkin/javafiddle/subscription","commits_url":"https://api.github.com/repos/roma-turkin/javafiddle/commits{/sha}","git_commits_url":"https://api.github.com/repos/roma-turkin/javafiddle/git/commits{/sha}","comments_url":"https://api.github.com/repos/roma-turkin/javafiddle/comments{/number}","issue_comment_url":"https://api.github.com/repos/roma-turkin/javafiddle/issues/comments{/number}","contents_url":"https://api.github.com/repos/roma-turkin/javafiddle/contents/{+path}","compare_url":"https://api.github.com/repos/roma-turkin/javafiddle/compare/{base}...{head}","merges_url":"https://api.github.com/repos/roma-turkin/javafiddle/merges","archive_url":"https://api.github.com/repos/roma-turkin/javafiddle/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/roma-turkin/javafiddle/downloads","issues_url":"https://api.github.com/repos/roma-turkin/javafiddle/issues{/number}","pulls_url":"https://api.github.com/repos/roma-turkin/javafiddle/pulls{/number}","milestones_url":"https://api.github.com/repos/roma-turkin/javafiddle/milestones{/number}","notifications_url":"https://api.github.com/repos/roma-turkin/javafiddle/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/roma-turkin/javafiddle/labels{/name}","releases_url":"https://api.github.com/repos/roma-turkin/javafiddle/releases{/id}","deployments_url":"https://api.github.com/repos/roma-turkin/javafiddle/deployments","created_at":"2015-10-11T10:57:50Z","updated_at":"2016-02-04T11:25:09Z","pushed_at":"2016-04-17T10:50:48Z","git_url":"git://github.com/roma-turkin/javafiddle.git","ssh_url":"git@github.com:roma-turkin/javafiddle.git","clone_url":"https://github.com/roma-turkin/javafiddle.git","svn_url":"https://github.com/roma-turkin/javafiddle","homepage":null,"size":6425,"stargazers_count":0,"watchers_count":0,"language":"JavaScript","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":2,"mirror_url":null,"open_issues_count":15,"forks":2,"open_issues":15,"watchers":0,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/roma-turkin/javafiddle/pulls/34"},"html":{"href":"https://github.com/roma-turkin/javafiddle/pull/34"},"issue":{"href":"https://api.github.com/repos/roma-turkin/javafiddle/issues/34"},"comments":{"href":"https://api.github.com/repos/roma-turkin/javafiddle/issues/34/comments"},"review_comments":{"href":"https://api.github.com/repos/roma-turkin/javafiddle/pulls/34/comments"},"review_comment":{"href":"https://api.github.com/repos/roma-turkin/javafiddle/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/roma-turkin/javafiddle/pulls/34/commits"},"statuses":{"href":"https://api.github.com/repos/roma-turkin/javafiddle/statuses/d9efe0c42b1ecf174a709400ed43661476b30e52"}}}}