Skip to content

Conversation

@jrenaat
Copy link
Member

@jrenaat jrenaat commented Oct 4, 2024

Resolve the driver name from the connection metadata, in case it wasn't explicitly set and access to the database metadata is allowed


By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license
and can be relicensed under the terms of the LGPL v2.1 license in the future at the maintainers' discretion.
For more information on licensing, please check here.


https://hibernate.atlassian.net/browse/HHH-18669

@jrenaat jrenaat requested a review from beikov October 4, 2024 21:26
Copy link
Member

@beikov beikov left a comment

Choose a reason for hiding this comment

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

I would rather not muddy the dialect with that information since this is only needed for logging purposes.
You can easily determine the driver name within a connection provider by acquiring a connection, asking for DatabaseMetaData on that connection and then releasing that connection again.

@jrenaat
Copy link
Member Author

jrenaat commented Oct 7, 2024

I would rather not muddy the dialect with that information since this is only needed for logging purposes. You can easily determine the driver name within a connection provider by acquiring a connection, asking for DatabaseMetaData on that connection and then releasing that connection again.

Yeah, I considered that as well, though do we really want to acquire another connection, and go get the same metedata info, when in this case we've already done it before? This is why i tried to find a way to pass that info in another way, even if not 'ideal' (which is why i also marked it as @internal) ?

@beikov
Copy link
Member

beikov commented Oct 7, 2024

The connection acquisition is "cheap" since it is a pooled connection, so it's fine IMO. Also, this is a startup only thing.

…case it wasn't explicitly set and access to the database metadata is allowed

Signed-off-by: Jan Schatteman <[email protected]>
@jrenaat jrenaat force-pushed the HHH-18669-dbdrivername branch from acd95ed to 95224aa Compare October 7, 2024 20:59
@jrenaat jrenaat requested a review from beikov October 8, 2024 14:46
Copy link
Member

@beikov beikov left a comment

Choose a reason for hiding this comment

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

LGTM

@jrenaat jrenaat merged commit bcac1e3 into hibernate:main Oct 9, 2024
24 checks passed
@jrenaat jrenaat deleted the HHH-18669-dbdrivername branch October 9, 2024 11:43
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.

2 participants