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
DS-3803 Remove db.jndi setting from dspace.cfg #1917
DS-3803 Remove db.jndi setting from dspace.cfg #1917
Conversation
As of DSpace 6.x this setting is no longer used and is not customizable by the user. Now DSpace always looks for a pool named "jdbc/dspace" in JNDI and falls back to creating a pool with the db.* settings located in dspace.cfg. See: https://wiki.duraspace.org/display/DSDOC6x/Configuration+Reference See: dspace/config/spring/api/core-hibernate.xml See: https://jira.duraspace.org/browse/DS-3434
8ccf88a
to
3bb04da
Compare
It may be better to update Hibernate to use this I believe, that'd just be a matter of changing this line: https://github.com/DSpace/DSpace/blob/master/dspace/config/spring/api/core-hibernate.xml#L41 To be:
I've not tested this, but other configurations in |
I've verified that your suggestion to update Hibernate to use the Truth be told, I wish this would behave like it did before and only try to use a database pool from JNDI if you've defined one. |
@alanorth : what happens if you simply leave So, I was hoping that leaving |
That's a good point, @tdonohue. I hadn't actually tried it with
|
Ok, thanks for the quick test there @alanorth. In that case, I'm not seeing a better option other than simply defaulting the
I'd also like to get @mwoodiupui's opinion on this new default, as I know he uses JNDI on a regular basis and helped get this setup properly in Hibernate to begin with in #1219 (Note: some of the comments in 1219 are now no longer 100% accurate, as at the point that 1219 was merged, all db settings had been temporarily removed from dspace.cfg. They have since been restored, but we neglected to restore |
My fix to remove I'm curious to hear @mwoodiupui thoughts too. By the way, I've also started using JNDI in DSpace 5.x and it was during my testing of DSpace 6.2 last week where I stumbled on DS-3434—that DSpace is actually not even able to start if a database pool is provided from JNDI. This is no longer trivial! |
I definitely do not want to lose the JNDI support! @tdonohue 's default looks reasonable. Here I leave it set to that and match the Please see DS-3434 which will, I think, be needed to make this work in 6+. |
Hold on, nobody said anything about removing JNDI support—my pull request was to merely remove the setting from
I'm glad that @mwoodiupui is making progress figuring out this rather serious regression (DS-3434). |
Yes, I should read more deeply instead of going with my initial "hey, I need that!" reaction. |
I agree, @mwoodiupui. I was happy to learn that DSpace 6.x just tries to find it and falls back to the other db.* settings from For example, I've been doing this in development lately. Configure separate pools for "web" and "api" requests in server.xml: <Resource name="jdbc/dspaceWeb" auth="Container" type="javax.sql.DataSource"
driverClassName="org.postgresql.Driver"
url="jdbc:postgresql://localhost:5432/dspace?ApplicationName=dspaceWeb"
...
testOnBorrow='true' />
<Resource name="jdbc/dspaceApi" auth="Container" type="javax.sql.DataSource"
driverClassName="org.postgresql.Driver"
url="jdbc:postgresql://localhost:5432/dspace?ApplicationName=dspaceApi"
...
testOnBorrow='true' /> Then each web application context, ie ROOT.xml: <Context docBase="[dspace]/webapps/xmlui">
<ResourceLink global="jdbc/dspaceWeb" name="jdbc/dspace" type="javax.sql.DataSource"/>
</Context> I can name them anything I want at the global level (and notice that I use JDBC trickery to set the pool name using |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
After discussion with @mwoodiupui in today's DevMtg, I'll give the original change suggested by @alanorth (to simply remove the db.jndi
) my support 👍
In the DevMtg, we've decided that it's better to enhance the documentation on using DSpace 6 + JNDI. @mwoodiupui volunteered to take the lead on that (and hopefully @alanorth can provide feedback/review at a minimum).
DevMtg logs: http://irclogs.duraspace.org/index.php?date=2018-01-24
So, this PR looks good to me, provided we enhance our 6.x Documentation around how to setup DSpace + JNDI properly: https://wiki.duraspace.org/display/DSDOC6x/
Perfect, @tdonohue. I'm happy to help with the documentation on setting up Tomcat with JNDI for DSpace. I spent quite a bit of time writing my verbose message to the dspace-tech mailing list a few weeks ago with the thought that I'd eventually need to document the process in a blog post or wiki page eventually anyways. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
+1 by inspection
Happy this is moving forward. For the record, @mwoodiupui and I added quite a bit more notes on setting up DSpace with JNDI on the DSpace 6.x Installing DSpace wiki page, covering use cases, JDBC driver installation, and Tomcat configuration. Looking good! |
DS-3803 Remove db.jndi setting from dspace.cfg Should be ported to master as well.
As of DSpace 6.x this setting is no longer used and is not customizable by the user because it is hard coded in the Hibernate config. We should remove it so we don't confuse users. This is slightly related to the issue in DS-3434.
See: https://wiki.duraspace.org/display/DSDOC6x/Configuration+Reference
See: dspace/config/spring/api/core-hibernate.xml