Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

PropertyBeanSetter fails to set DataSource#url for some databases #45

Closed
brmeyer opened this issue Mar 19, 2014 · 4 comments
Closed

PropertyBeanSetter fails to set DataSource#url for some databases #45

brmeyer opened this issue Mar 19, 2014 · 4 comments

Comments

@brmeyer
Copy link

brmeyer commented Mar 19, 2014

Slightly older versions of H2 provide JdbcDataSource#setURL, but not JdbcDataSource#setUrl. That was corrected in a recent revision, however it will cause issues for many Hibernate users. Could PropertyBeanSetter#setTargetFromProperties be improved to handle crappy JDBC impls? ;)

I'm including a workaround in hibernate-hikaricp, for now.

Thanks!

@brettwooldridge
Copy link
Owner

Two things. Because the PropertyBeanSetter is purely reflection based, URL would work as a property. However, probably the cleanest way for me to address this that follows the principle of least astonishment is to have the PropertyBeanSetter first try the property as specified, and if the setter is not found, try to find the method by upper-casing the property name. What do you think?

@brmeyer
Copy link
Author

brmeyer commented Mar 20, 2014

Yep, exactly what I had in mind! And you're correct -- my workaround sets URL as a property in hibernate-hikaricp. This may only be an issue for the specific versions of H2, but I haven't audited any other DBs to see if that's the case anywhere else. Thanks!

@brettwooldridge
Copy link
Owner

I've already committed this change and a test case this morning (well, morning here in Tokyo).

@brmeyer
Copy link
Author

brmeyer commented Mar 20, 2014

Great, thanks for the quick response!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants