HHH-18538 fix startup logging for DatasourceConnectionProviderImpl and multi-tenant version

Signed-off-by: Gavin King <gavin@hibernate.org>
This commit is contained in:
Gavin King 2024-08-30 18:40:51 +02:00
parent 8aa37a9d85
commit 47c99d5a31
2 changed files with 16 additions and 4 deletions

View File

@ -139,13 +139,20 @@ public class DatasourceConnectionProviderImpl implements ConnectionProvider, Con
@Override @Override
public DatabaseConnectionInfo getDatabaseConnectionInfo(Dialect dialect) { public DatabaseConnectionInfo getDatabaseConnectionInfo(Dialect dialect) {
return new DatabaseConnectionInfoImpl( return new DatabaseConnectionInfoImpl(
"Connecting through datasource '" + (dataSourceJndiName != null ? dataSourceJndiName : dataSource) + "'", null,
null, null,
dialect.getVersion(), dialect.getVersion(),
null, null,
null, null,
null, null,
null null
); ) {
@Override
public String toInfoString() {
return dataSourceJndiName != null
? "\tDatasource JND name [" + dataSourceJndiName + "]"
: "\tProvided DataSource";
}
};
} }
} }

View File

@ -125,14 +125,19 @@ public class DataSourceBasedMultiTenantConnectionProviderImpl<T>
@Override @Override
public DatabaseConnectionInfo getDatabaseConnectionInfo(Dialect dialect) { public DatabaseConnectionInfo getDatabaseConnectionInfo(Dialect dialect) {
return new DatabaseConnectionInfoImpl( return new DatabaseConnectionInfoImpl(
"Multi-tenant - " + tenantIdentifierForAny, null,
null, null,
dialect.getVersion(), dialect.getVersion(),
null, null,
null, null,
null, null,
null null
); ) {
@Override
public String toInfoString() {
return "\tMulti-tenant datasource JNDI name [" + jndiName + ']';
}
};
} }
} }