Skip to content

Commit 3700bbf

Browse files
beikovsebersole
authored andcommitted
HHH-17734 Ensure provider_class has precedence over datasource
1 parent 00d6777 commit 3700bbf

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

hibernate-core/src/main/java/org/hibernate/engine/jdbc/connections/internal/ConnectionProviderInitiator.java

+4-4
Original file line numberDiff line numberDiff line change
@@ -104,10 +104,6 @@ public ConnectionProvider initiateService(
104104
return null;
105105
}
106106

107-
if ( configurationValues.get( AvailableSettings.DATASOURCE ) != null ) {
108-
return new DatasourceConnectionProviderImpl();
109-
}
110-
111107
final StrategySelector strategySelector = registry.getService( StrategySelector.class );
112108
final Object explicitSetting = configurationValues.get( AvailableSettings.CONNECTION_PROVIDER );
113109
if ( explicitSetting != null ) {
@@ -150,6 +146,10 @@ else if ( explicitSetting instanceof Class ) {
150146
}
151147
}
152148

149+
if ( configurationValues.get( AvailableSettings.DATASOURCE ) != null ) {
150+
return new DatasourceConnectionProviderImpl();
151+
}
152+
153153
ConnectionProvider connectionProvider = null;
154154

155155
final Class<? extends ConnectionProvider> singleRegisteredProvider = getSingleRegisteredProvider(

0 commit comments

Comments
 (0)