Skip to content

Add failure analysis for Hibernate bootstrap failures - #51510

Closed
exijn wants to merge 1 commit into
spring-projects:mainfrom
exijn:issue-1573-hibernate-bootstrap-failure-analyzer
Closed

Add failure analysis for Hibernate bootstrap failures#51510
exijn wants to merge 1 commit into
spring-projects:mainfrom
exijn:issue-1573-hibernate-bootstrap-failure-analyzer

Conversation

@exijn

@exijn exijn commented Aug 30, 2026

Copy link
Copy Markdown

Description

When Hibernate cannot obtain JDBC metadata during JPA bootstrap, the resulting ServiceException contains a HibernateException reporting that the dialect could not be determined. Spring Boot currently has JDBC failure analyzers, but none of them handles this Hibernate bootstrap failure, so the underlying configuration problem is not explained by failure analysis.

This change adds a focused analyzer that matches the ServiceException/HibernateException cause structure produced by Hibernate ORM 7.4.5.Final and the stable Unable to determine Dialect without JDBC metadata message prefix. It describes the JDBC metadata failure and suggests checking the JDBC URL, credentials, driver, and database availability, or configuring spring.jpa.database-platform when appropriate. It does not infer a DataSource prefix or bean name, and it skips unrelated Hibernate, JDBC, and bean creation failures.

The regression tests cover direct and nested cause chains, an actual JPA bootstrap failure with an unavailable DataSource, unrelated failures, and successful bootstrap when a dialect is configured.

Closes gh-1573

Verification

  • ./gradlew :module:spring-boot-hibernate:check
  • ./gradlew check
  • git diff --check

Signed-off-by: hej090224 <fc49854985@gmail.com>
@spring-projects-issues spring-projects-issues added the status: waiting-for-triage An issue we've not yet triaged label Aug 30, 2026
@wilkinsona

Copy link
Copy Markdown
Member

I think this is too big a leap forward as we haven't yet gathered all of the relevant information.

There are various scenarios discussed in #1573. The point is also made that the reported behavior is, to some extent at least, a Hibernate problem. Also, someone mentioned submitting a Hibernate pull request to improve things on that side but it's not clear if that happened.

As I said on #1573, the step that we need to take first is to gather information about how Hibernate behaves. Once we have that information for the various scenarios discussed in #1573 (and perhaps any others that we think may be common), we can review the situation and decide what, if anything, we want to do on the Spring Boot side and what, if anything, still needs to be improved on the Hibernate side.

Thanks anyway for the PR. Please update #1573 with your findings thus far and we can review.

@wilkinsona wilkinsona closed this Sep 1, 2026
@wilkinsona wilkinsona added status: declined A suggestion or change that we don't feel we should currently apply and removed status: waiting-for-triage An issue we've not yet triaged labels Sep 1, 2026
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.

Add a failure analyzer for Hibernate bootstrap failure

3 participants