-
-
Couldn't load subscription status.
- Fork 102
Terrible error reporting when JDBC scheme is not recognized #2478 #2499
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
Conversation
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.
Awesome, thanks so much @dreab8, looks good!
|
Unfortunately the solution is causing issues with Microsoft SQL Server , working on a different solution |
7d4fe59 to
ee8e2ef
Compare
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.
Thanks, it looks good overall. I just need a couple of clarifications.
...e-core/src/main/java/org/hibernate/reactive/pool/impl/DefaultSqlClientPoolConfiguration.java
Outdated
Show resolved
Hide resolved
...e-core/src/main/java/org/hibernate/reactive/pool/impl/DefaultSqlClientPoolConfiguration.java
Show resolved
Hide resolved
hibernate-reactive-core/src/test/java/org/hibernate/reactive/WrongJdbcUrlShemeTest.java
Outdated
Show resolved
Hide resolved
...e-core/src/main/java/org/hibernate/reactive/provider/service/NoJdbcEnvironmentInitiator.java
Outdated
Show resolved
Hide resolved
| @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:')") |
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.
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" ); |
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.
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); |
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.
JdbcUrlParserTest expects an IllegalArgumentException and not an HibernateException.
I think it makes sense to return an IllegalArgumentException here.
|
Thanks |
Fix #2478