Skip to content

Conversation

govi20
Copy link
Contributor

@govi20 govi20 commented Oct 29, 2018

Added the failure analyzer for StrategySelectionException. Hibernate is throwing StrategySelectionException for the missing dialect value.

@spring-projects-issues spring-projects-issues added the status: waiting-for-triage An issue we've not yet triaged label Oct 29, 2018
@philwebb
Copy link
Member

@govi20 Thanks very much for looking into this. Ideally, before we merge this, we'd like to also get a test in place.

@govi20
Copy link
Contributor Author

govi20 commented Oct 29, 2018

@philwebb Okay. I will be writing the test cases for the analyzer. Any idea why this build failed? I didn't make any change in FieldValues.java.

@philwebb
Copy link
Member

I'm not sure why the CI failed, you could try rebasing on the latest master. The CI for that is currently green. Don't worry if it fails again, it looks unrelated to your work.

Copy link
Member

@snicoll snicoll left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you very much for opening your first PR to Spring Boot.

This issue is very old as it's quite complex to solve. Last time we had a look to it, there were more cases to take into account. It may very well be that Hibernate has changed and doesn't behave that way anymore. That's why exercising the error is quite important.

protected FailureAnalysis analyze(Throwable rootFailure,
StrategySelectionException strategySelectionException) {
return new FailureAnalysis(
"Dialect value is missing against database or incorrect value is provided!",
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think we need a bit more than that. Hibernate may throw that exception when it cannot access the database. Pointing the user to the potentially wrong fix would causing more harm IMO.

There's no way to prove that our auto-configuration lead to this so pointing to the property may be misleading as well. We usually try to throw dedicated exception whenever we can.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for flagging it out. I did not test the scenario's with old hibernate version.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It's not so much about old Hibernate version but more about Hibernate failing to boostrap for whatever reason. A good way to move forward would be to contribute tests that are showcasing various cases where Hibernate could not start. We could then use that tests suite as a base for the failure analyzer. Would you be willing to update the PR in that direction?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sure Stephane, I will start working in that direction.

@snicoll snicoll added status: waiting-for-feedback We need additional information before we can continue for: team-attention An issue we'd like other members of the team to review labels Nov 1, 2018
@philwebb philwebb changed the title #1573: Add a failure analyzer for Hibernate bootstrap failure Add a failure analyzer for Hibernate bootstrap failure Nov 2, 2018
@snicoll snicoll removed the for: team-attention An issue we'd like other members of the team to review label Nov 7, 2018
@snicoll
Copy link
Member

snicoll commented Dec 4, 2018

@govi20 thanks for the PR but this isn't going in the direction the original issue was opened against. I've removed the ideal for contribution label for this one as I believe we need to revisit our initial goal against the current state of affair. Thanks for your efforts, in any case!

@snicoll snicoll closed this Dec 4, 2018
@snicoll snicoll added status: declined A suggestion or change that we don't feel we should currently apply and removed status: waiting-for-feedback We need additional information before we can continue status: waiting-for-triage An issue we've not yet triaged labels Dec 4, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

status: declined A suggestion or change that we don't feel we should currently apply

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants