1616import org .hibernate .engine .jdbc .connections .spi .ConnectionProvider ;
1717import org .hibernate .engine .jdbc .connections .spi .DatabaseConnectionInfo ;
1818import org .hibernate .engine .jndi .spi .JndiService ;
19+ import org .hibernate .internal .log .ConnectionInfoLogger ;
1920import org .hibernate .service .UnknownUnwrapTypeException ;
2021import org .hibernate .service .spi .Configurable ;
2122import org .hibernate .service .spi .InjectService ;
@@ -87,8 +88,8 @@ else if ( DataSource.class.isAssignableFrom( unwrapType ) ) {
8788 public void configure (Map <String , Object > configValues ) {
8889 if ( dataSource == null ) {
8990 final Object dataSourceSetting = configValues .get ( DATASOURCE );
90- if ( dataSourceSetting instanceof DataSource ) {
91- dataSource = ( DataSource ) dataSourceSetting ;
91+ if ( dataSourceSetting instanceof DataSource ds ) {
92+ dataSource = ds ;
9293 }
9394 else {
9495 final String dataSourceJndiName = (String ) dataSourceSetting ;
@@ -109,6 +110,15 @@ public void configure(Map<String, Object> configValues) {
109110 throw new HibernateException ( "Unable to determine appropriate DataSource to use" );
110111 }
111112
113+ if ( configValues .containsKey ( AvailableSettings .AUTOCOMMIT ) ) {
114+ ConnectionInfoLogger .INSTANCE .ignoredSetting ( AvailableSettings .AUTOCOMMIT ,
115+ DatasourceConnectionProviderImpl .class );
116+ }
117+ if ( configValues .containsKey ( AvailableSettings .ISOLATION ) ) {
118+ ConnectionInfoLogger .INSTANCE .ignoredSetting ( AvailableSettings .ISOLATION ,
119+ DatasourceConnectionProviderImpl .class );
120+ }
121+
112122 user = (String ) configValues .get ( AvailableSettings .USER );
113123 pass = (String ) configValues .get ( AvailableSettings .PASS );
114124 useCredentials = user != null || pass != null ;
0 commit comments