-
Notifications
You must be signed in to change notification settings - Fork 492
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
6819 - Include PostgreSQL JDBC driver in WAR #7048
Conversation
… PostgreSQL driver no longer necessary. See IQSS#6819.
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.
The idea behind this pull request is that we don't need to instruct people to put the postgres driver in the "lib" directory of Payara. (Typically this is done with the installer.) Rather, we can bundle it with the Dataverse war file. It's small, less than 900K.
I did the following quick test:
- Remove postgres driver from "lib" in Payara.
- Try to run "develop". Fails, as expected.
- Switch to this branch. Works. The postgres driver doesn't need to be in "lib". Great.
Changes are made to the installer in this pull request and I didn't test them. They should be tested. As of this writing the Perl installer hasn't been updated. I'm not sure if we're maintaining both.
The Makefile was also updated to no longer include the driver.
After chatting with @landreev I pulled this out of QA so he has time to comment. @poikilotherm one thing that you could perhaps comment on... What is the short term or long term vision for this change? I saw stuff about "modern" and Testcontainers and configuration via annotations. Is that where we're going? Thanks. 😄 |
This may not be an issue necessarily, I'm just curious to understand how this works. If the driver is part of the application war file, this means it is only available while the application is deployed. But the database is defined on the domain level ( On our production servers we define this data source with the extra "validation-required" attributes: What about the ejb timer - in our setup, it uses the main PG database. But the timer is an application of its own, and it appears to still be there (deployed under I just want to know for sure that Payara is not going to be confused and crash after |
I did not test what happens when you undeploy, as this no scenario for me. As long as the app will be deployed, the domain level and timer database connections seem to work just fine. |
The answer appears to be "yes" - I was able to do things like
Sure, but undeploying and redeploying is part of normal operations. So we need know for sure it's not going to result in Payara crashing every time, especially with the database monitoring in the configuration. Should also be a straightforward thing to test; but it is an extra thing to test. I'm wondering if it would be ok to delay testing and merging this PR until after dataverse v5 is released? I don't have a strong opinion on this, but will ask others on the team. |
Hi Leonid @landreev, my mid term goal for all of this is moving the database definitions from the installer/server level to the application. Not just the DB connection, but ideally all resource definitions currently done by the installer. It will be configurable, so no one has to be afraid of lost control. Once this is done, there will be no problem with a dangling connection, as it is available as long as the app is deployed. 😉 I felt like this would be beyond scope for this issue/PR, but if you think this should be done in the same go, I'd be happy to add more. We can keep it to the DB connection for now. IMHO this would be a major step forward in terms of modern deployment strategies. |
This commit is a first test to apply database configuration and credentials to the application server without using a config on domain level but on application level. It is not very configurable yet. The JNDI names have been changed to be conform with Java EE 7. See https://github.com/javaee-samples/javaee7-samples/tree/master/jpa/datasourcedefinition-applicationxml-pu and others for working examples. (Staying with the old name was not successfull.) We had to use the "global" scope, so the persistent EJB timers are successfully created and stored in the database. Using the "app" scope crashes the deployment.
@landreev and @pdurbin I changed this to a draft PR again to avoid accidents. Please note that I added two commits (e90d9e7 & 0aaac25) that add the necessary bits for defining the database within the app. Some notes about this. Please find some literature about how to do this and advantages/disadvantages here:
And please note that I switched from |
Did you upgrade Payara? |
@poikilotherm I think I have found it but not sure yet why: the db name is dvndbsimple but it is listed twice. probably something I did, will need to look over where it is configured.
|
@kcondon not sure if your last comment was a question, a note to self or a hint I should chime in...? |
@poikilotherm Apologies, was distracted but will dive back in. |
@poikilotherm OK, I've found what didn't work with the manual steps. It turns out I needed to specify host and port even though it was running on localhost, 5432 so the following instructions in release notes appear to be incorrect: Also: I am not able to get the harvest timer to work and restarting payara does not reload the application, though it is listed in memory as deployed. Issues: Friday was not my best testing day, given all the blind alleys I went down, so perhaps some of the above will resolve on Monday upon review. I will go through them once more to confirm but it might help to have someone else on the team validate the update from existing payara, pre .5. |
@poikilotherm Passing back for comments or resolution on issues. |
2d9edea
to
93d3b6a
Compare
Issues found by QA (@kcondon):
@kcondon can we try this again...? EDIT: Maybe we should solve #5345 first, before attacking this. Feel free to move back to Code Review / Community Dev. |
@donsizemore as you mentioned it today on IRC: do you want us to update to PostgreSQL Client 42.2.18? From what I can see from the Changelog between .12 and .18, there shouldn't be anything biting back when pushed. |
I'm keeping this pull request in code review for now but I expect some movement after @poikilotherm @scolapasta @landreev @qqmyers and I discuss it after the community call on Tuesday. My take (after discussing with @poikilotherm yesterday) is that this pull request and the 5345-nonpersistent-ejb branch linked from #5345 could be split up into four smaller pull requests that could move across the board in this order:
Even if we don't split up this pull request, I don't believe we want to merge it as-is because there are problems with undeploying (having to do with timers using the database). |
What this PR does / why we need it:
With Payara 5, we don't have to deal with pushing the Postgres driver JAR into the right places. Instead it's much easier to have a single place to run to: a version used in pom.xml, shipped with the WAR, used consistently on the app server deployment.
Which issue(s) this PR closes:
Closes #6819
Special notes for your reviewer:
Nada. Maybe the docs changes about the timer issues. Would be very strange to see those again.
Suggestions on how to test this:
Follow release notes docs and guide docs. Deploy to Payara. Look for the EJB timers being created in the DB. Test as usual. This should work as before. Looking at the Flyway Schema History should also reveal that the migrations have been applied as usual.
Does this PR introduce a user interface change? If mockups are available, please link/include them here:
Nope.
Is there a release notes update needed for this change?:
🔋 included.
Additional documentation:
Nada.