{"action":"created","issue":{"url":"https://api.github.com/repos/OHDSI/WebAPI/issues/24","labels_url":"https://api.github.com/repos/OHDSI/WebAPI/issues/24/labels{/name}","comments_url":"https://api.github.com/repos/OHDSI/WebAPI/issues/24/comments","events_url":"https://api.github.com/repos/OHDSI/WebAPI/issues/24/events","html_url":"https://github.com/OHDSI/WebAPI/pull/24","id":61267944,"number":24,"title":"Clearer distinction between DataSource handling (CDM vs OHDSI)","user":{"login":"alexfranken","id":5394963,"avatar_url":"https://avatars.githubusercontent.com/u/5394963?v=3","gravatar_id":"","url":"https://api.github.com/users/alexfranken","html_url":"https://github.com/alexfranken","followers_url":"https://api.github.com/users/alexfranken/followers","following_url":"https://api.github.com/users/alexfranken/following{/other_user}","gists_url":"https://api.github.com/users/alexfranken/gists{/gist_id}","starred_url":"https://api.github.com/users/alexfranken/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/alexfranken/subscriptions","organizations_url":"https://api.github.com/users/alexfranken/orgs","repos_url":"https://api.github.com/users/alexfranken/repos","events_url":"https://api.github.com/users/alexfranken/events{/privacy}","received_events_url":"https://api.github.com/users/alexfranken/received_events","type":"User","site_admin":false},"labels":[],"state":"closed","locked":false,"assignee":null,"milestone":null,"comments":3,"created_at":"2015-03-13T22:02:44Z","updated_at":"2015-03-15T02:31:45Z","closed_at":"2015-03-15T00:47:54Z","pull_request":{"url":"https://api.github.com/repos/OHDSI/WebAPI/pulls/24","html_url":"https://github.com/OHDSI/WebAPI/pull/24","diff_url":"https://github.com/OHDSI/WebAPI/pull/24.diff","patch_url":"https://github.com/OHDSI/WebAPI/pull/24.patch"},"body":"@chrisknoll & @fdefalco , I realized that the datasource plumbing wasn't really in line with what I believe to be our intent.  That is, the CDM schema should be read-only and that we want the OHDSI/RESULTS schema  to be transactional.  \r\nFlyway config was right but the Jpa & Job config was really using the default datasource, which was the \"CDM DataSource\".\r\nSo, I tweaked the configuration to make a cleaner distinction between CDM & OHDSI DataSources (including JdbcTemplates).  So, within WebAPI, the idea is that when you need transaction support, you should work with the ohdsiDataSource/ohdsiJdbcTemplate/transactionTemplate/crudrepository (any of) beans.  For example, the /vocabulary/vocabularies endpoint would use the CDM JdbcTemplate (getJdbcTemplate in AbstractDAOService), and the tasklets, etc., that write data, would use the OHDSI JdbcTemplate (getOhdsiJdbcTemplate in AbstractDAOService).\r\nI think this makes sense from the WebAPI perspective and supports variable configurations.  I don't think it was an issue for any of us because we were all configuring WebAPI with DB accounts that were associated with the OHDSI schema, or had a \"CDM\" account that could write to the OHDSI schema...\r\n\r\nTo take it a step further, we could rename the \"flyway.datasource\" properties to represent the ohdsi.datasource but I didn't go there due to the impact to others and their settings.xml.\r\n\r\nLet me know any thoughts you all have."},"comment":{"url":"https://api.github.com/repos/OHDSI/WebAPI/issues/comments/80805931","html_url":"https://github.com/OHDSI/WebAPI/pull/24#issuecomment-80805931","issue_url":"https://api.github.com/repos/OHDSI/WebAPI/issues/24","id":80805931,"user":{"login":"chrisknoll","id":6818777,"avatar_url":"https://avatars.githubusercontent.com/u/6818777?v=3","gravatar_id":"","url":"https://api.github.com/users/chrisknoll","html_url":"https://github.com/chrisknoll","followers_url":"https://api.github.com/users/chrisknoll/followers","following_url":"https://api.github.com/users/chrisknoll/following{/other_user}","gists_url":"https://api.github.com/users/chrisknoll/gists{/gist_id}","starred_url":"https://api.github.com/users/chrisknoll/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/chrisknoll/subscriptions","organizations_url":"https://api.github.com/users/chrisknoll/orgs","repos_url":"https://api.github.com/users/chrisknoll/repos","events_url":"https://api.github.com/users/chrisknoll/events{/privacy}","received_events_url":"https://api.github.com/users/chrisknoll/received_events","type":"User","site_admin":false},"created_at":"2015-03-15T02:31:45Z","updated_at":"2015-03-15T02:31:45Z","body":"Hey, Alex, maybe I was misunderstanding you.  ohdsi and cdms are defintely distinct/separate things.  I just see us doing querys that will bridge those things.  Like getting data from the cdm to do your analysis into heracles. But there could be other cases...and it might be advantageous to have a distinct line between a cdm datasouce and a ohdsi one...I can think of one such case in our own environment where we have a cdm on PDW and our ohdsi schema might be on a sql2014 instance.  In this case, I wouldn't be able to join across the different instances, but then i'd have to resort to pulling data from a query from the CDM into memory and dump it back into Sql2014 for processing. That sounds possible but posslby a bit I/O intensive to get the data. And then to take the results of taht processing and join it back into a query against the PDW server, i don't know how that would be possible.\r\n\r\nWhat circumstances were you thinking about where we'd have distinct datasources?  Maybe something was discussed but I'm just missing it.\r\n\r\n-Chris\r\n"}}