Skip to content

Commit e34e872

Browse files
authored
Merge branch 'hibernate:main' into minor-cleanup
2 parents fc485f3 + 7df1f66 commit e34e872

File tree

302 files changed

+4890
-4271
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

302 files changed

+4890
-4271
lines changed

ci/release/Jenkinsfile

Lines changed: 9 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -255,12 +255,15 @@ pipeline {
255255
]) {
256256
sshagent( ['ed25519.Hibernate-CI.github.com', 'hibernate.filemgmt.jboss.org', 'hibernate-ci.frs.sourceforge.net'] ) {
257257
dir( '.release/hibernate.org' ) {
258-
checkout scmGit(
259-
branches: [[name: '*/production']],
260-
extensions: [],
261-
userRemoteConfigs: [[credentialsId: 'ed25519.Hibernate-CI.github.com', url: 'https://github.com/hibernate/hibernate.org.git']]
262-
)
263-
sh "../scripts/website-release.sh ${env.SCRIPT_OPTIONS} ${env.PROJECT} ${env.RELEASE_VERSION}"
258+
// Lock to avoid rejected pushes when multiple releases try to clone-commit-push
259+
lock('hibernate.org-git') {
260+
checkout scmGit(
261+
branches: [[name: '*/production']],
262+
extensions: [],
263+
userRemoteConfigs: [[credentialsId: 'ed25519.Hibernate-CI.github.com', url: 'https://github.com/hibernate/hibernate.org.git']]
264+
)
265+
sh "../scripts/website-release.sh ${env.SCRIPT_OPTIONS} ${env.PROJECT} ${env.RELEASE_VERSION}"
266+
}
264267
}
265268
}
266269
}

gradle/gradle-develocity.gradle

Lines changed: 2 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -9,8 +9,8 @@
99

1010
ext {
1111
isCiEnvironment = isJenkins() || isGitHubActions() || isGenericCi()
12-
populateRemoteBuildCache = isEnabled( "POPULATE_REMOTE_GRADLE_CACHE" )
13-
useRemoteCache = !isEnabled( "DISABLE_REMOTE_GRADLE_CACHE" )
12+
populateRemoteBuildCache = getSetting('POPULATE_REMOTE_GRADLE_CACHE').orElse('false').toBoolean()
13+
useRemoteCache = !getSetting('DISABLE_REMOTE_GRADLE_CACHE').orElse('false').toBoolean()
1414
}
1515

1616
private static boolean isJenkins() {
@@ -35,14 +35,6 @@ static java.util.Optional<String> getSetting(String name) {
3535
return java.util.Optional.ofNullable(sysProp);
3636
}
3737

38-
static boolean isEnabled(String setting) {
39-
if ( System.getenv().hasProperty( setting ) ) {
40-
return true
41-
}
42-
43-
return System.hasProperty( setting )
44-
}
45-
4638
develocity {
4739
server = 'https://develocity.commonhaus.dev'
4840

hibernate-agroal/src/main/java/org/hibernate/agroal/internal/AgroalConnectionProvider.java

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,6 @@
2323
import org.hibernate.engine.jdbc.connections.spi.ConnectionProviderConfigurationException;
2424
import org.hibernate.engine.jdbc.connections.spi.DatabaseConnectionInfo;
2525
import org.hibernate.exception.JDBCConnectionException;
26-
import org.hibernate.internal.log.ConnectionInfoLogger;
2726
import org.hibernate.service.UnknownUnwrapTypeException;
2827
import org.hibernate.service.spi.Configurable;
2928
import org.hibernate.service.spi.Stoppable;
@@ -45,6 +44,7 @@
4544
import static org.hibernate.engine.jdbc.connections.internal.DatabaseConnectionInfoImpl.getSchema;
4645
import static org.hibernate.engine.jdbc.connections.internal.DatabaseConnectionInfoImpl.hasCatalog;
4746
import static org.hibernate.engine.jdbc.connections.internal.DatabaseConnectionInfoImpl.hasSchema;
47+
import static org.hibernate.internal.log.ConnectionInfoLogger.CONNECTION_INFO_LOGGER;
4848

4949
/**
5050
* {@link ConnectionProvider} based on Agroal connection pool.
@@ -105,7 +105,7 @@ private static <T> void copyProperty(Map<String, Object> properties, String key,
105105

106106
@Override
107107
public void configure(Map<String, Object> properties) throws HibernateException {
108-
ConnectionInfoLogger.INSTANCE.configureConnectionPool( "Agroal" );
108+
CONNECTION_INFO_LOGGER.configureConnectionPool( "Agroal" );
109109
try {
110110
final var config = toStringValuedProperties( properties );
111111
if ( !properties.containsKey( AgroalSettings.AGROAL_MAX_SIZE ) ) {
@@ -130,7 +130,7 @@ public void configure(Map<String, Object> properties) throws HibernateException
130130
agroalDataSource = AgroalDataSource.from( agroalProperties );
131131
}
132132
catch ( Exception e ) {
133-
ConnectionInfoLogger.INSTANCE.unableToInstantiateConnectionPool( e );
133+
CONNECTION_INFO_LOGGER.unableToInstantiateConnectionPool( e );
134134
throw new ConnectionProviderConfigurationException(
135135
"Could not configure Agroal: " + e.getMessage(), e );
136136
}
@@ -225,7 +225,7 @@ else if ( unwrapType.isAssignableFrom( AgroalDataSource.class ) ) {
225225
@Override
226226
public void stop() {
227227
if ( agroalDataSource != null ) {
228-
ConnectionInfoLogger.INSTANCE.cleaningUpConnectionPool(
228+
CONNECTION_INFO_LOGGER.cleaningUpConnectionPool(
229229
agroalDataSource.getConfiguration()
230230
.connectionPoolConfiguration()
231231
.connectionFactoryConfiguration()

hibernate-agroal/src/main/java/org/hibernate/agroal/internal/StrategyRegistrationProviderImpl.java

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -4,13 +4,13 @@
44
*/
55
package org.hibernate.agroal.internal;
66

7-
import java.util.Collections;
8-
97
import org.hibernate.boot.registry.selector.SimpleStrategyRegistrationImpl;
108
import org.hibernate.boot.registry.selector.StrategyRegistration;
119
import org.hibernate.boot.registry.selector.StrategyRegistrationProvider;
1210
import org.hibernate.engine.jdbc.connections.spi.ConnectionProvider;
1311

12+
import static java.util.Collections.singleton;
13+
1414
/**
1515
* Provides the {@link AgroalConnectionProvider} to the
1616
* {@link org.hibernate.boot.registry.selector.spi.StrategySelector} service.
@@ -20,16 +20,15 @@
2020
public final class StrategyRegistrationProviderImpl implements StrategyRegistrationProvider {
2121

2222
@Override
23-
public Iterable<StrategyRegistration> getStrategyRegistrations() {
24-
final SimpleStrategyRegistrationImpl<ConnectionProvider> strategyRegistration = new SimpleStrategyRegistrationImpl<>(
23+
public Iterable<StrategyRegistration<?>> getStrategyRegistrations() {
24+
return singleton( new SimpleStrategyRegistrationImpl<>(
2525
ConnectionProvider.class,
2626
AgroalConnectionProvider.class,
2727
AgroalConnectionProvider.class.getSimpleName(),
2828
"agroal",
2929
"Agroal",
3030
// for consistency's sake
3131
"org.hibernate.connection.AgroalConnectionProvider"
32-
);
33-
return Collections.singleton( strategyRegistration );
32+
) );
3433
}
3534
}

hibernate-c3p0/src/main/java/org/hibernate/c3p0/internal/C3P0ConnectionProvider.java

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,6 @@
1414
import org.hibernate.engine.jdbc.connections.spi.ConnectionProviderConfigurationException;
1515
import org.hibernate.engine.jdbc.connections.spi.DatabaseConnectionInfo;
1616
import org.hibernate.exception.JDBCConnectionException;
17-
import org.hibernate.internal.log.ConnectionInfoLogger;
1817
import org.hibernate.service.UnknownUnwrapTypeException;
1918
import org.hibernate.service.spi.Configurable;
2019
import org.hibernate.service.spi.ServiceRegistryAwareService;
@@ -51,6 +50,7 @@
5150
import static org.hibernate.engine.jdbc.connections.internal.DatabaseConnectionInfoImpl.getSchema;
5251
import static org.hibernate.engine.jdbc.connections.internal.DatabaseConnectionInfoImpl.hasCatalog;
5352
import static org.hibernate.engine.jdbc.connections.internal.DatabaseConnectionInfoImpl.hasSchema;
53+
import static org.hibernate.internal.log.ConnectionInfoLogger.CONNECTION_INFO_LOGGER;
5454
import static org.hibernate.internal.util.config.ConfigurationHelper.getBoolean;
5555
import static org.hibernate.internal.util.config.ConfigurationHelper.getInteger;
5656

@@ -135,7 +135,7 @@ else if ( unwrapType.isAssignableFrom( DataSource.class ) ) {
135135

136136
@Override
137137
public void configure(Map<String, Object> properties) {
138-
ConnectionInfoLogger.INSTANCE.configureConnectionPool( "c3p0" );
138+
CONNECTION_INFO_LOGGER.configureConnectionPool( "c3p0" );
139139

140140
final String jdbcDriverClass = extractSetting(
141141
properties,
@@ -205,15 +205,15 @@ private DataSource createDataSource(String jdbcUrl, Properties connectionProps,
205205
return pooledDataSource( unpooledDataSource( jdbcUrl, connectionProps ), poolProperties );
206206
}
207207
catch (Exception e) {
208-
ConnectionInfoLogger.INSTANCE.unableToInstantiateConnectionPool( e );
208+
CONNECTION_INFO_LOGGER.unableToInstantiateConnectionPool( e );
209209
throw new ConnectionProviderConfigurationException(
210210
"Could not configure c3p0: " + e.getMessage(), e );
211211
}
212212
}
213213

214214
private void loadDriverClass(String jdbcDriverClass) {
215215
if ( jdbcDriverClass == null ) {
216-
ConnectionInfoLogger.INSTANCE.jdbcDriverNotSpecified();
216+
CONNECTION_INFO_LOGGER.jdbcDriverNotSpecified();
217217
}
218218
else {
219219
try {
@@ -313,12 +313,12 @@ private void warnPropertyConflict(String hibernateStyle, String c3p0Style) {
313313

314314
@Override
315315
public void stop() {
316-
ConnectionInfoLogger.INSTANCE.cleaningUpConnectionPool( C3P0_CONFIG_PREFIX );
316+
CONNECTION_INFO_LOGGER.cleaningUpConnectionPool( C3P0_CONFIG_PREFIX );
317317
try {
318318
DataSources.destroy( dataSource );
319319
}
320320
catch (SQLException sqle) {
321-
ConnectionInfoLogger.INSTANCE.unableToDestroyConnectionPool( sqle );
321+
CONNECTION_INFO_LOGGER.unableToDestroyConnectionPool( sqle );
322322
}
323323
}
324324

hibernate-c3p0/src/main/java/org/hibernate/c3p0/internal/StrategyRegistrationProviderImpl.java

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -4,13 +4,13 @@
44
*/
55
package org.hibernate.c3p0.internal;
66

7-
import java.util.Collections;
8-
97
import org.hibernate.boot.registry.selector.SimpleStrategyRegistrationImpl;
108
import org.hibernate.boot.registry.selector.StrategyRegistration;
119
import org.hibernate.boot.registry.selector.StrategyRegistrationProvider;
1210
import org.hibernate.engine.jdbc.connections.spi.ConnectionProvider;
1311

12+
import static java.util.Collections.singleton;
13+
1414
/**
1515
* Provides the {@link C3P0ConnectionProvider} to the
1616
* {@link org.hibernate.boot.registry.selector.spi.StrategySelector} service.
@@ -20,8 +20,8 @@
2020
public final class StrategyRegistrationProviderImpl implements StrategyRegistrationProvider {
2121

2222
@Override
23-
public Iterable<StrategyRegistration> getStrategyRegistrations() {
24-
final SimpleStrategyRegistrationImpl<ConnectionProvider> c3p0 = new SimpleStrategyRegistrationImpl<>(
23+
public Iterable<StrategyRegistration<?>> getStrategyRegistrations() {
24+
return singleton( new SimpleStrategyRegistrationImpl<>(
2525
ConnectionProvider.class,
2626
C3P0ConnectionProvider.class,
2727
"c3p0",
@@ -30,7 +30,6 @@ public Iterable<StrategyRegistration> getStrategyRegistrations() {
3030
"org.hibernate.connection.C3P0ConnectionProvider",
3131
// legacy
3232
"org.hibernate.service.jdbc.connections.internal.C3P0ConnectionProvider"
33-
);
34-
return Collections.singleton( c3p0 );
33+
) );
3534
}
3635
}

hibernate-community-dialects/src/main/java/org/hibernate/community/dialect/HANALegacyServerConfiguration.java

Lines changed: 7 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -17,9 +17,9 @@
1717
import org.hibernate.engine.jdbc.dialect.spi.DialectResolutionInfo;
1818
import org.hibernate.internal.util.StringHelper;
1919
import org.hibernate.internal.util.config.ConfigurationHelper;
20+
import org.jboss.logging.Logger;
2021

2122
import static org.hibernate.cfg.DialectSpecificSettings.HANA_MAX_LOB_PREFETCH_SIZE;
22-
import static org.hibernate.internal.CoreMessageLogger.CORE_LOGGER;
2323

2424
/**
2525
* Utility class that extracts some initial configuration from the database for {@link HANALegacyDialect}.
@@ -60,9 +60,8 @@ public static HANALegacyServerConfiguration fromDialectResolutionInfo(DialectRes
6060
}
6161
catch (SQLException e) {
6262
// Ignore
63-
CORE_LOGGER.debug(
64-
"An error occurred while trying to determine the database version.",
65-
e );
63+
Logger.getLogger( HANALegacyServerConfiguration.class )
64+
.debug( "An error occurred while trying to determine the database version.", e );
6665
}
6766

6867
if (databaseMajorVersion > 0 && databaseMajorVersion < 4) {
@@ -77,9 +76,8 @@ public static HANALegacyServerConfiguration fromDialectResolutionInfo(DialectRes
7776
}
7877
catch (SQLException e) {
7978
// Ignore
80-
CORE_LOGGER.debug(
81-
"An error occurred while trying to determine the value of the HANA parameter indexserver.ini / session / max_lob_prefetch_size.",
82-
e );
79+
Logger.getLogger( HANALegacyServerConfiguration.class )
80+
.debug( "An error occurred while trying to determine the value of the HANA parameter indexserver.ini / session / max_lob_prefetch_size.", e );
8381
}
8482
}
8583
else {
@@ -115,7 +113,8 @@ public static DatabaseVersion determineDatabaseVersion(DialectResolutionInfo inf
115113
}
116114
catch (SQLException e) {
117115
// Ignore
118-
CORE_LOGGER.debug( "An error occurred while trying to determine the HANA Cloud version.", e );
116+
Logger.getLogger( HANALegacyServerConfiguration.class )
117+
.debug( "An error occurred while trying to determine the HANA Cloud version.", e );
119118
}
120119
}
121120
return databaseVersion == null

hibernate-community-dialects/src/main/java/org/hibernate/community/dialect/HSQLLegacyDialect.java

Lines changed: 2 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,6 @@
5050
import org.hibernate.exception.spi.SQLExceptionConversionDelegate;
5151
import org.hibernate.exception.spi.TemplatedViolatedConstraintNameExtractor;
5252
import org.hibernate.exception.spi.ViolatedConstraintNameExtractor;
53-
import org.hibernate.internal.CoreMessageLogger;
5453
import org.hibernate.internal.util.JdbcExceptionHelper;
5554
import org.hibernate.internal.util.ReflectHelper;
5655
import org.hibernate.metamodel.mapping.EntityMappingType;
@@ -79,7 +78,6 @@
7978
import org.hibernate.type.spi.TypeConfiguration;
8079
import org.jboss.logging.Logger;
8180

82-
import java.lang.invoke.MethodHandles;
8381
import java.sql.DatabaseMetaData;
8482
import java.sql.SQLException;
8583
import java.sql.Types;
@@ -100,11 +98,7 @@
10098
*/
10199
public class HSQLLegacyDialect extends Dialect {
102100

103-
private static final CoreMessageLogger LOG = Logger.getMessageLogger(
104-
MethodHandles.lookup(),
105-
CoreMessageLogger.class,
106-
org.hibernate.community.dialect.HSQLLegacyDialect.class.getName()
107-
);
101+
private static final Logger LOG = Logger.getLogger( HSQLLegacyDialect.class );
108102

109103
private final UniqueDelegate uniqueDelegate = new CreateTableUniqueDelegate( this );
110104
private final HSQLIdentityColumnSupport identityColumnSupport;
@@ -762,7 +756,7 @@ private ReadUncommittedLockingStrategy(EntityPersister lockable, LockMode lockMo
762756
public void lock(Object id, Object version, Object object, int timeout, SharedSessionContractImplementor session)
763757
throws StaleObjectStateException, JDBCException {
764758
if ( getLockMode().greaterThan( LockMode.READ ) ) {
765-
LOG.hsqldbSupportsOnlyReadCommittedIsolation();
759+
LOG.warn( "HSQLDB supports only READ_UNCOMMITTED isolation" );
766760
}
767761
super.lock( id, version, object, timeout, session );
768762
}

0 commit comments

Comments
 (0)