{"action":"created","comment":{"url":"https://api.github.com/repos/IQSS/dataverse/pulls/comments/207981966","pull_request_review_id":143702909,"id":207981966,"node_id":"MDI0OlB1bGxSZXF1ZXN0UmV2aWV3Q29tbWVudDIwNzk4MTk2Ng==","diff_hunk":"@@ -1,9 +1,9 @@\n <?xml version=\"1.0\" encoding=\"UTF-8\"?>\n <persistence version=\"1.0\" xmlns=\"http://java.sun.com/xml/ns/persistence\" xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\" xsi:schemaLocation=\"http://java.sun.com/xml/ns/persistence http://java.sun.com/xml/ns/persistence/persistence_1_0.xsd\">\n-    <persistence-unit name=\"VDCNet-ejbPU\" transaction-type=\"JTA\">\n+    <persistence-unit name=\"VDCNet-ejbPU-1\" transaction-type=\"JTA\">","path":"src/main/resources/META-INF/persistence.xml","position":null,"original_position":4,"commit_id":"78459b596b4594b7da0f84ede0d5da9ac47dac32","original_commit_id":"de76c7f3c4b17a21102666418244c6627b767be7","user":{"login":"tkmonson","id":40394344,"node_id":"MDQ6VXNlcjQwMzk0MzQ0","avatar_url":"https://avatars2.githubusercontent.com/u/40394344?v=4","gravatar_id":"","url":"https://api.github.com/users/tkmonson","html_url":"https://github.com/tkmonson","followers_url":"https://api.github.com/users/tkmonson/followers","following_url":"https://api.github.com/users/tkmonson/following{/other_user}","gists_url":"https://api.github.com/users/tkmonson/gists{/gist_id}","starred_url":"https://api.github.com/users/tkmonson/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/tkmonson/subscriptions","organizations_url":"https://api.github.com/users/tkmonson/orgs","repos_url":"https://api.github.com/users/tkmonson/repos","events_url":"https://api.github.com/users/tkmonson/events{/privacy}","received_events_url":"https://api.github.com/users/tkmonson/received_events","type":"User","site_admin":false},"body":"Renamed to masterPU.","created_at":"2018-08-06T18:09:12Z","updated_at":"2018-08-06T18:09:12Z","html_url":"https://github.com/IQSS/dataverse/pull/4916#discussion_r207981966","pull_request_url":"https://api.github.com/repos/IQSS/dataverse/pulls/4916","author_association":"CONTRIBUTOR","_links":{"self":{"href":"https://api.github.com/repos/IQSS/dataverse/pulls/comments/207981966"},"html":{"href":"https://github.com/IQSS/dataverse/pull/4916#discussion_r207981966"},"pull_request":{"href":"https://api.github.com/repos/IQSS/dataverse/pulls/4916"}},"in_reply_to_id":207358404},"pull_request":{"url":"https://api.github.com/repos/IQSS/dataverse/pulls/4916","id":205797949,"node_id":"MDExOlB1bGxSZXF1ZXN0MjA1Nzk3OTQ5","html_url":"https://github.com/IQSS/dataverse/pull/4916","diff_url":"https://github.com/IQSS/dataverse/pull/4916.diff","patch_url":"https://github.com/IQSS/dataverse/pull/4916.patch","issue_url":"https://api.github.com/repos/IQSS/dataverse/issues/4916","number":4916,"state":"open","locked":false,"title":"[WIP -- DO NOT MERGE] 4765: Guest users read from a secondary datasource when accessing a published dataset","user":{"login":"tkmonson","id":40394344,"node_id":"MDQ6VXNlcjQwMzk0MzQ0","avatar_url":"https://avatars2.githubusercontent.com/u/40394344?v=4","gravatar_id":"","url":"https://api.github.com/users/tkmonson","html_url":"https://github.com/tkmonson","followers_url":"https://api.github.com/users/tkmonson/followers","following_url":"https://api.github.com/users/tkmonson/following{/other_user}","gists_url":"https://api.github.com/users/tkmonson/gists{/gist_id}","starred_url":"https://api.github.com/users/tkmonson/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/tkmonson/subscriptions","organizations_url":"https://api.github.com/users/tkmonson/orgs","repos_url":"https://api.github.com/users/tkmonson/repos","events_url":"https://api.github.com/users/tkmonson/events{/privacy}","received_events_url":"https://api.github.com/users/tkmonson/received_events","type":"User","site_admin":false},"body":"Added support for a second datasource that will point to the master database as well as any secondary replicas. This involved:\r\n\r\n- Adding a second persistence unit in persistence.xml and changing the name of the original persistence unit.\r\n\r\n- Adding a second datasource and second connection pool in glassfish-setup.sh.\r\n\r\n- Writing chooseEM() in DatasetServiceBean to determine when to read from a primary or secondary.\r\n\r\n- Many other additions and little tweaks to names of variables.\r\n\r\nCurrently, this is only being used in the event of a guest user reading a published dataset, but reading from a secondary datasource could easily be implemented for many other events.\r\n\r\nIdeally, the second EntityManager should be created only if it is needed (i.e. within a conditional branch in chooseEM). However, I decided to stay consistent with the rest of the code, which configures persistence units in persistence.xml and injects EntityManagers via the @PersistenceContext annotation. It might be possible to instantiate EntityManagers dynamically using an EntityManagerFactory, but I'm not convinced that would be a better solution. More info on both of these approachs [here](https://stackoverflow.com/a/24572869).\r\n\r\nconnects to #4765","created_at":"2018-08-02T16:49:02Z","updated_at":"2018-08-06T18:09:12Z","closed_at":null,"merged_at":null,"merge_commit_sha":"94d1f4a2dc512cff5b0a49e23712107964ebe419","assignee":null,"assignees":[],"requested_reviewers":[],"requested_teams":[],"labels":[],"milestone":null,"commits_url":"https://api.github.com/repos/IQSS/dataverse/pulls/4916/commits","review_comments_url":"https://api.github.com/repos/IQSS/dataverse/pulls/4916/comments","review_comment_url":"https://api.github.com/repos/IQSS/dataverse/pulls/comments{/number}","comments_url":"https://api.github.com/repos/IQSS/dataverse/issues/4916/comments","statuses_url":"https://api.github.com/repos/IQSS/dataverse/statuses/78459b596b4594b7da0f84ede0d5da9ac47dac32","head":{"label":"tkmonson:4765_scaled_database","ref":"4765_scaled_database","sha":"78459b596b4594b7da0f84ede0d5da9ac47dac32","user":{"login":"tkmonson","id":40394344,"node_id":"MDQ6VXNlcjQwMzk0MzQ0","avatar_url":"https://avatars2.githubusercontent.com/u/40394344?v=4","gravatar_id":"","url":"https://api.github.com/users/tkmonson","html_url":"https://github.com/tkmonson","followers_url":"https://api.github.com/users/tkmonson/followers","following_url":"https://api.github.com/users/tkmonson/following{/other_user}","gists_url":"https://api.github.com/users/tkmonson/gists{/gist_id}","starred_url":"https://api.github.com/users/tkmonson/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/tkmonson/subscriptions","organizations_url":"https://api.github.com/users/tkmonson/orgs","repos_url":"https://api.github.com/users/tkmonson/repos","events_url":"https://api.github.com/users/tkmonson/events{/privacy}","received_events_url":"https://api.github.com/users/tkmonson/received_events","type":"User","site_admin":false},"repo":{"id":137935747,"node_id":"MDEwOlJlcG9zaXRvcnkxMzc5MzU3NDc=","name":"dataverse","full_name":"tkmonson/dataverse","owner":{"login":"tkmonson","id":40394344,"node_id":"MDQ6VXNlcjQwMzk0MzQ0","avatar_url":"https://avatars2.githubusercontent.com/u/40394344?v=4","gravatar_id":"","url":"https://api.github.com/users/tkmonson","html_url":"https://github.com/tkmonson","followers_url":"https://api.github.com/users/tkmonson/followers","following_url":"https://api.github.com/users/tkmonson/following{/other_user}","gists_url":"https://api.github.com/users/tkmonson/gists{/gist_id}","starred_url":"https://api.github.com/users/tkmonson/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/tkmonson/subscriptions","organizations_url":"https://api.github.com/users/tkmonson/orgs","repos_url":"https://api.github.com/users/tkmonson/repos","events_url":"https://api.github.com/users/tkmonson/events{/privacy}","received_events_url":"https://api.github.com/users/tkmonson/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/tkmonson/dataverse","description":"A data repository framework to share and publish research data.","fork":true,"url":"https://api.github.com/repos/tkmonson/dataverse","forks_url":"https://api.github.com/repos/tkmonson/dataverse/forks","keys_url":"https://api.github.com/repos/tkmonson/dataverse/keys{/key_id}","collaborators_url":"https://api.github.com/repos/tkmonson/dataverse/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/tkmonson/dataverse/teams","hooks_url":"https://api.github.com/repos/tkmonson/dataverse/hooks","issue_events_url":"https://api.github.com/repos/tkmonson/dataverse/issues/events{/number}","events_url":"https://api.github.com/repos/tkmonson/dataverse/events","assignees_url":"https://api.github.com/repos/tkmonson/dataverse/assignees{/user}","branches_url":"https://api.github.com/repos/tkmonson/dataverse/branches{/branch}","tags_url":"https://api.github.com/repos/tkmonson/dataverse/tags","blobs_url":"https://api.github.com/repos/tkmonson/dataverse/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/tkmonson/dataverse/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/tkmonson/dataverse/git/refs{/sha}","trees_url":"https://api.github.com/repos/tkmonson/dataverse/git/trees{/sha}","statuses_url":"https://api.github.com/repos/tkmonson/dataverse/statuses/{sha}","languages_url":"https://api.github.com/repos/tkmonson/dataverse/languages","stargazers_url":"https://api.github.com/repos/tkmonson/dataverse/stargazers","contributors_url":"https://api.github.com/repos/tkmonson/dataverse/contributors","subscribers_url":"https://api.github.com/repos/tkmonson/dataverse/subscribers","subscription_url":"https://api.github.com/repos/tkmonson/dataverse/subscription","commits_url":"https://api.github.com/repos/tkmonson/dataverse/commits{/sha}","git_commits_url":"https://api.github.com/repos/tkmonson/dataverse/git/commits{/sha}","comments_url":"https://api.github.com/repos/tkmonson/dataverse/comments{/number}","issue_comment_url":"https://api.github.com/repos/tkmonson/dataverse/issues/comments{/number}","contents_url":"https://api.github.com/repos/tkmonson/dataverse/contents/{+path}","compare_url":"https://api.github.com/repos/tkmonson/dataverse/compare/{base}...{head}","merges_url":"https://api.github.com/repos/tkmonson/dataverse/merges","archive_url":"https://api.github.com/repos/tkmonson/dataverse/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/tkmonson/dataverse/downloads","issues_url":"https://api.github.com/repos/tkmonson/dataverse/issues{/number}","pulls_url":"https://api.github.com/repos/tkmonson/dataverse/pulls{/number}","milestones_url":"https://api.github.com/repos/tkmonson/dataverse/milestones{/number}","notifications_url":"https://api.github.com/repos/tkmonson/dataverse/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/tkmonson/dataverse/labels{/name}","releases_url":"https://api.github.com/repos/tkmonson/dataverse/releases{/id}","deployments_url":"https://api.github.com/repos/tkmonson/dataverse/deployments","created_at":"2018-06-19T19:24:07Z","updated_at":"2018-08-03T20:50:20Z","pushed_at":"2018-08-06T17:57:38Z","git_url":"git://github.com/tkmonson/dataverse.git","ssh_url":"git@github.com:tkmonson/dataverse.git","clone_url":"https://github.com/tkmonson/dataverse.git","svn_url":"https://github.com/tkmonson/dataverse","homepage":"http://dataverse.org","size":68507,"stargazers_count":0,"watchers_count":0,"language":"Java","has_issues":false,"has_projects":true,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":0,"mirror_url":null,"archived":false,"open_issues_count":0,"license":{"key":"other","name":"Other","spdx_id":null,"url":null,"node_id":"MDc6TGljZW5zZTA="},"forks":0,"open_issues":0,"watchers":0,"default_branch":"develop"}},"base":{"label":"IQSS:develop","ref":"develop","sha":"db89320f7d346f4612e195004d42edc82408d095","user":{"login":"IQSS","id":675237,"node_id":"MDEyOk9yZ2FuaXphdGlvbjY3NTIzNw==","avatar_url":"https://avatars2.githubusercontent.com/u/675237?v=4","gravatar_id":"","url":"https://api.github.com/users/IQSS","html_url":"https://github.com/IQSS","followers_url":"https://api.github.com/users/IQSS/followers","following_url":"https://api.github.com/users/IQSS/following{/other_user}","gists_url":"https://api.github.com/users/IQSS/gists{/gist_id}","starred_url":"https://api.github.com/users/IQSS/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/IQSS/subscriptions","organizations_url":"https://api.github.com/users/IQSS/orgs","repos_url":"https://api.github.com/users/IQSS/repos","events_url":"https://api.github.com/users/IQSS/events{/privacy}","received_events_url":"https://api.github.com/users/IQSS/received_events","type":"Organization","site_admin":false},"repo":{"id":14051004,"node_id":"MDEwOlJlcG9zaXRvcnkxNDA1MTAwNA==","name":"dataverse","full_name":"IQSS/dataverse","owner":{"login":"IQSS","id":675237,"node_id":"MDEyOk9yZ2FuaXphdGlvbjY3NTIzNw==","avatar_url":"https://avatars2.githubusercontent.com/u/675237?v=4","gravatar_id":"","url":"https://api.github.com/users/IQSS","html_url":"https://github.com/IQSS","followers_url":"https://api.github.com/users/IQSS/followers","following_url":"https://api.github.com/users/IQSS/following{/other_user}","gists_url":"https://api.github.com/users/IQSS/gists{/gist_id}","starred_url":"https://api.github.com/users/IQSS/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/IQSS/subscriptions","organizations_url":"https://api.github.com/users/IQSS/orgs","repos_url":"https://api.github.com/users/IQSS/repos","events_url":"https://api.github.com/users/IQSS/events{/privacy}","received_events_url":"https://api.github.com/users/IQSS/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/IQSS/dataverse","description":"A data repository framework to share and publish research data.","fork":false,"url":"https://api.github.com/repos/IQSS/dataverse","forks_url":"https://api.github.com/repos/IQSS/dataverse/forks","keys_url":"https://api.github.com/repos/IQSS/dataverse/keys{/key_id}","collaborators_url":"https://api.github.com/repos/IQSS/dataverse/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/IQSS/dataverse/teams","hooks_url":"https://api.github.com/repos/IQSS/dataverse/hooks","issue_events_url":"https://api.github.com/repos/IQSS/dataverse/issues/events{/number}","events_url":"https://api.github.com/repos/IQSS/dataverse/events","assignees_url":"https://api.github.com/repos/IQSS/dataverse/assignees{/user}","branches_url":"https://api.github.com/repos/IQSS/dataverse/branches{/branch}","tags_url":"https://api.github.com/repos/IQSS/dataverse/tags","blobs_url":"https://api.github.com/repos/IQSS/dataverse/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/IQSS/dataverse/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/IQSS/dataverse/git/refs{/sha}","trees_url":"https://api.github.com/repos/IQSS/dataverse/git/trees{/sha}","statuses_url":"https://api.github.com/repos/IQSS/dataverse/statuses/{sha}","languages_url":"https://api.github.com/repos/IQSS/dataverse/languages","stargazers_url":"https://api.github.com/repos/IQSS/dataverse/stargazers","contributors_url":"https://api.github.com/repos/IQSS/dataverse/contributors","subscribers_url":"https://api.github.com/repos/IQSS/dataverse/subscribers","subscription_url":"https://api.github.com/repos/IQSS/dataverse/subscription","commits_url":"https://api.github.com/repos/IQSS/dataverse/commits{/sha}","git_commits_url":"https://api.github.com/repos/IQSS/dataverse/git/commits{/sha}","comments_url":"https://api.github.com/repos/IQSS/dataverse/comments{/number}","issue_comment_url":"https://api.github.com/repos/IQSS/dataverse/issues/comments{/number}","contents_url":"https://api.github.com/repos/IQSS/dataverse/contents/{+path}","compare_url":"https://api.github.com/repos/IQSS/dataverse/compare/{base}...{head}","merges_url":"https://api.github.com/repos/IQSS/dataverse/merges","archive_url":"https://api.github.com/repos/IQSS/dataverse/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/IQSS/dataverse/downloads","issues_url":"https://api.github.com/repos/IQSS/dataverse/issues{/number}","pulls_url":"https://api.github.com/repos/IQSS/dataverse/pulls{/number}","milestones_url":"https://api.github.com/repos/IQSS/dataverse/milestones{/number}","notifications_url":"https://api.github.com/repos/IQSS/dataverse/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/IQSS/dataverse/labels{/name}","releases_url":"https://api.github.com/repos/IQSS/dataverse/releases{/id}","deployments_url":"https://api.github.com/repos/IQSS/dataverse/deployments","created_at":"2013-11-01T18:47:39Z","updated_at":"2018-08-03T21:32:28Z","pushed_at":"2018-08-06T17:57:40Z","git_url":"git://github.com/IQSS/dataverse.git","ssh_url":"git@github.com:IQSS/dataverse.git","clone_url":"https://github.com/IQSS/dataverse.git","svn_url":"https://github.com/IQSS/dataverse","homepage":"http://dataverse.org","size":68692,"stargazers_count":323,"watchers_count":323,"language":"Java","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":176,"mirror_url":null,"archived":false,"open_issues_count":808,"license":{"key":"other","name":"Other","spdx_id":null,"url":null,"node_id":"MDc6TGljZW5zZTA="},"forks":176,"open_issues":808,"watchers":323,"default_branch":"develop"}},"_links":{"self":{"href":"https://api.github.com/repos/IQSS/dataverse/pulls/4916"},"html":{"href":"https://github.com/IQSS/dataverse/pull/4916"},"issue":{"href":"https://api.github.com/repos/IQSS/dataverse/issues/4916"},"comments":{"href":"https://api.github.com/repos/IQSS/dataverse/issues/4916/comments"},"review_comments":{"href":"https://api.github.com/repos/IQSS/dataverse/pulls/4916/comments"},"review_comment":{"href":"https://api.github.com/repos/IQSS/dataverse/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/IQSS/dataverse/pulls/4916/commits"},"statuses":{"href":"https://api.github.com/repos/IQSS/dataverse/statuses/78459b596b4594b7da0f84ede0d5da9ac47dac32"}},"author_association":"CONTRIBUTOR"}}
{"actor":{"display_login":"tkmonson"}}