Skip to content

Conversation

@dreab8
Copy link
Member

@dreab8 dreab8 commented Sep 9, 2025

Fix #2478

Copy link
Member

@gavinking gavinking left a comment

Choose a reason for hiding this comment

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

Awesome, thanks so much @dreab8, looks good!

@dreab8
Copy link
Member Author

dreab8 commented Sep 10, 2025

Unfortunately the solution is causing issues with Microsoft SQL Server , working on a different solution

@dreab8 dreab8 force-pushed the issue_2478 branch 3 times, most recently from 7d4fe59 to ee8e2ef Compare September 10, 2025 11:55
Copy link
Member

@DavideD DavideD left a comment

Choose a reason for hiding this comment

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

Thanks, it looks good overall. I just need a couple of clarifications.

@Message(id = 48, value = "Could not determine Dialect from JDBC driver metadata (specify a connection URI with scheme 'postgresql:', 'mysql:', 'cockroachdb', or 'db2:')")
HibernateException couldNotDetermineDialectFromJdbcDriverMetadata();

@Message(id = 49, value = "Could not determine Dialect from connection URI: '%1$s' (specify a connection URI with scheme 'postgresql:', 'mysql:', 'cockroachdb', or 'db2:')")
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 that the list of supported schemas in the error message is missing postgres:, oracle:, sqlserver:, and mariadb:


private static void assertException(Throwable throwable) {
assertThat( throwable.getMessage() )
.contains( "HR000049" );
Copy link
Member

@DavideD DavideD Sep 24, 2025

Choose a reason for hiding this comment

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

Could you change this to

		assertThat( throwable ).hasMessageContaining( "HR000049" );

please?

It will give us extra information about the exception thrown if something is wrong with the message

HibernateException couldNotDetermineDialectFromJdbcDriverMetadata();

@Message(id = 49, value = "Could not determine Dialect from connection URI: '%1$s' (specify a connection URI with scheme 'postgresql:', 'mysql:', 'cockroachdb', or 'db2:')")
HibernateException couldNotDetermineDialectFromConnectionURI(String url);
Copy link
Member

Choose a reason for hiding this comment

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

JdbcUrlParserTest expects an IllegalArgumentException and not an HibernateException.
I think it makes sense to return an IllegalArgumentException here.

@DavideD DavideD merged commit df4f703 into hibernate:main Sep 24, 2025
19 checks passed
@DavideD
Copy link
Member

DavideD commented Sep 24, 2025

Thanks

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

terrible error reporting when JDBC scheme is not recognized

3 participants