Skip to content
This repository was archived by the owner on Apr 17, 2018. It is now read-only.

better support for JNDI URLs#186

Merged
tpitale merged 1 commit into
datamapper:masterfrom
patcheng:release-1.2
May 24, 2016
Merged

better support for JNDI URLs#186
tpitale merged 1 commit into
datamapper:masterfrom
patcheng:release-1.2

Conversation

@patcheng

Copy link
Copy Markdown
Contributor

similar to changes for JNDI support in DataObjects. There might be a better way, but I didn't want to upset to much stuff

@carlhoerberg

Copy link
Copy Markdown

+1

@tillsc

tillsc commented Dec 7, 2012

Copy link
Copy Markdown

+1

Taking action on this seems really necessary to me. Even without @patcheng's Pull request in datamapper/do#25. As far as I have seen there is absolutely no chance to setup a DataMapper connection without specifying an explicit adapter name in the URI scheme. But this must always be "java:" for JNDI so DM tries to require 'dm-java-adapter'.

I'm not sure if it's really necessary to do all the magic for detecting the driver/adapter automatically. The following example (implementable by just 2-3 lines of code) would be fine for me too:

DataMapper.setup(:default, 'java:/comp/env/jdbc/upb?scheme=oracle') 

@patcheng

Copy link
Copy Markdown
Contributor Author

in my case, I was using the same URI in java code, so I didn't want to decorate the URI.

It's been a while, but I pretty much copy-n-paste variation the driver detection from other parts of either DataObject, dm-core or dm-migration.

@tpitale

tpitale commented Mar 26, 2015

Copy link
Copy Markdown
Member

Any chance we could get some specs on this?

@tillsc

tillsc commented Mar 26, 2015

Copy link
Copy Markdown

Specs for JNDI based connections working on travis? That would definitely be a hard one :)

I also have a Tomcat/Oracle11 Setup (but unfortunately without JNDI jet). If someone is basically willing to merge this in I could test the patch in my environment at least.

@tpitale

tpitale commented Mar 26, 2015

Copy link
Copy Markdown
Member

Oh wow, yeah, it makes a connection to get meta data in order to determine the driver?

@tillsc

tillsc commented Mar 26, 2015

Copy link
Copy Markdown

Isn't that cool? :)

@tpitale tpitale merged commit fc68d0e into datamapper:master May 24, 2016
@mbj

mbj commented May 24, 2016

Copy link
Copy Markdown
Member

@tpitale Sorry to be annoying, but this does not have any specs either.

@tpitale

tpitale commented May 24, 2016

Copy link
Copy Markdown
Member

I commented on that as well below.

@mbj

mbj commented May 24, 2016

Copy link
Copy Markdown
Member

@tpitale I think its possible to write specs for this without actually connecting a real DB, message expectations.

@tpitale

tpitale commented May 24, 2016

Copy link
Copy Markdown
Member

Yeah, I could write tests which stub out the bits of the java responses. @tillsc thoughts?

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants