Bug 1051349
| Summary: | sql db cannot be connected via java datasource after db cartridge restart on the first time | ||||||||
|---|---|---|---|---|---|---|---|---|---|
| Product: | OpenShift Online | Reporter: | Meng Bo <bmeng> | ||||||
| Component: | Image | Assignee: | Ben Parees <bparees> | ||||||
| Status: | CLOSED CURRENTRELEASE | QA Contact: | libra bugs <libra-bugs> | ||||||
| Severity: | medium | Docs Contact: | |||||||
| Priority: | medium | ||||||||
| Version: | 2.x | CC: | bparees, rsmeral | ||||||
| Target Milestone: | --- | ||||||||
| Target Release: | --- | ||||||||
| Hardware: | Unspecified | ||||||||
| OS: | Unspecified | ||||||||
| Whiteboard: | |||||||||
| Fixed In Version: | Doc Type: | Bug Fix | |||||||
| Doc Text: | Story Points: | --- | |||||||
| Clone Of: | Environment: | ||||||||
| Last Closed: | 2014-01-30 00:55:10 UTC | Type: | Bug | ||||||
| Regression: | --- | Mount Type: | --- | ||||||
| Documentation: | --- | CRM: | |||||||
| Verified Versions: | Category: | --- | |||||||
| oVirt Team: | --- | RHEL 7.3 requirements from Atomic Host: | |||||||
| Cloudforms Team: | --- | Target Upstream Version: | |||||||
| Embargoed: | |||||||||
| Attachments: |
|
||||||||
|
Description
Meng Bo
2014-01-10 05:56:43 UTC
When the application uses CDI and JPA, it doesn't recover after the first refresh. It keeps throwing exceptions and behaves as described here: https://www.openshift.com/forums/openshift/eap-cant-connect-to-db-after-db-restart The attachment cdi-jpa-reproducer-kitchensink.war reproduces this behaviour: 1. Deploy to an EAP+MySQL OS app as ROOT.war 2. Open the app URL 3. Restart just the DB gear 4. Open the app URL again, exception appears Also, stopping+starting doesn't make any difference compared to restarting in this case. Created attachment 848263 [details]
cdi-jpa-reproducer-kitchensink.war
I'm going to decrease the connection validation period from 10 minutes to 1 minute in the default jboss configuration file. If that is still not frequent enough, there are two additional options you can use by modifying your applications datasource definition in the standalone.xml: 1) validate-on-match (commented out in the new config) which will validate the connection every time it is checked out of the pool 2) lower the background check interval, which is currently 60,000 milliseconds. Created attachment 849099 [details]
script_to_connect_db
Ah, forgot to add the attachment..
The advice given in comment 3 both seem to help the issue. Ben, can you please apply the same fix in datasources other than MySQL as well? I can confirm that the same problem happens at least with PostgreSQL. Yes I am going to update both datasources that come out of the box, for both jbossas and jbosseap. Commit pushed to master at https://github.com/openshift/origin-server https://github.com/openshift/origin-server/commit/5d979d0b269a062fdb2a097178b9faf9eceb4502 Bug 1051349 - sql db cannot be connected via java datasource after db cartridge restart on the first time Checked on devenv_4219, for both my case and Ron's case are worked fine now. After only db restart the mysql db still can be connected. Move bug to verified. |