Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
import java.util.TimeZone;

import static java.util.Collections.addAll;
import static org.hibernate.internal.CoreMessageLogger.LOGGER;
import static org.hibernate.internal.CoreMessageLogger.CORE_LOGGER;

/**
* SessionBuilder implementation.
Expand Down Expand Up @@ -148,7 +148,7 @@ public List<SessionEventListener> getCustomSessionEventListeners() {

@Override
public SessionImplementor openSession() {
LOGGER.tracef( "Opening Hibernate Session [tenant=%s]", tenantIdentifier );
CORE_LOGGER.openingSession( tenantIdentifier );
return createSession();
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@
import java.util.TimeZone;

import static java.util.Collections.addAll;
import static org.hibernate.internal.CoreMessageLogger.LOGGER;
import static org.hibernate.internal.CoreMessageLogger.CORE_LOGGER;

/**
* @author Steve Ebersole
Expand Down Expand Up @@ -82,7 +82,7 @@ protected SharedSessionBuilderImplementor getThis() {

@Override
public SessionImplementor openSession() {
LOGGER.tracef( "Opening Session [tenant=%s]", tenantIdentifier );
CORE_LOGGER.openingSession( tenantIdentifier );
if ( original.getFactory().getSessionFactoryOptions().isMultiTenancyEnabled() ) {
if ( shareTransactionContext ) {
if ( tenantIdChanged ) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
import java.util.Objects;
import java.util.TimeZone;

import static org.hibernate.internal.CoreMessageLogger.LOGGER;
import static org.hibernate.internal.CoreMessageLogger.CORE_LOGGER;

/**
* Builder for shared {@linkplain StatelessSessionImplementor stateless} sessions.
Expand Down Expand Up @@ -60,7 +60,7 @@ protected SharedStatelessSessionBuilder getThis() {

@Override
public StatelessSessionImplementor open() {
LOGGER.tracef( "Opening StatelessSession [tenant=%s]", tenantIdentifier );
CORE_LOGGER.openingStatelessSession( tenantIdentifier );
if ( original.getSessionFactory().getSessionFactoryOptions().isMultiTenancyEnabled() ) {
if ( shareTransactionContext ) {
final var tenantId = original.getTenantIdentifierValue();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
import java.util.List;
import java.util.TimeZone;

import static org.hibernate.internal.CoreMessageLogger.LOGGER;
import static org.hibernate.internal.CoreMessageLogger.CORE_LOGGER;

/**
* @author Steve Ebersole
Expand All @@ -42,7 +42,7 @@ protected StatelessSessionBuilder getThis() {

@Override
public StatelessSession openStatelessSession() {
LOGGER.tracef( "Opening StatelessSession [tenant=%s]", tenantIdentifier );
CORE_LOGGER.openingStatelessSession( tenantIdentifier );
return createStatelessSession();
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@
public interface JdbcLogging extends BasicLogger {
String NAME = SubSystemLogging.BASE + ".jdbc";

JdbcLogging JDBC_MESSAGE_LOGGER = Logger.getMessageLogger( MethodHandles.lookup(), JdbcLogging.class, NAME );
JdbcLogging JDBC_LOGGER = Logger.getMessageLogger( MethodHandles.lookup(), JdbcLogging.class, NAME );

@LogMessage(level = WARN)
@Message(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
import org.hibernate.engine.jdbc.spi.SqlStatementLogger;

import static java.util.Objects.requireNonNull;
import static org.hibernate.engine.jdbc.JdbcLogging.JDBC_MESSAGE_LOGGER;
import static org.hibernate.engine.jdbc.JdbcLogging.JDBC_LOGGER;
import static org.hibernate.engine.jdbc.batch.JdbcBatchLogging.BATCH_MESSAGE_LOGGER;
import static org.hibernate.sql.model.ModelMutationLogging.MODEL_MUTATION_LOGGER;

Expand Down Expand Up @@ -284,7 +284,7 @@ private void checkRowCounts(int[] rowCounts, PreparedStatementDetails statementD
throws SQLException, HibernateException {
final int numberOfRowCounts = rowCounts.length;
if ( batchPosition != 0 && numberOfRowCounts != batchPosition ) {
JDBC_MESSAGE_LOGGER.unexpectedRowCounts(
JDBC_LOGGER.unexpectedRowCounts(
statementDetails.getMutatingTableDetails().getTableName(),
numberOfRowCounts,
batchPosition
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
import static java.sql.ResultSet.TYPE_SCROLL_INSENSITIVE;
import static java.util.Collections.emptyList;
import static java.util.stream.StreamSupport.stream;
import static org.hibernate.engine.jdbc.JdbcLogging.JDBC_MESSAGE_LOGGER;
import static org.hibernate.engine.jdbc.JdbcLogging.JDBC_LOGGER;
import static org.hibernate.engine.jdbc.env.spi.SQLStateType.interpretReportedSQLStateType;

/**
Expand Down Expand Up @@ -271,7 +271,7 @@ private List<SequenceInformation> sequenceInformationList() {
connectionAccess.releaseConnection( connection );
}
catch (SQLException exception) {
JDBC_MESSAGE_LOGGER.unableToReleaseConnection( exception );
JDBC_LOGGER.unableToReleaseConnection( exception );
}
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@
import static org.hibernate.cfg.MappingSettings.DEFAULT_CATALOG;
import static org.hibernate.cfg.MappingSettings.DEFAULT_SCHEMA;
import static org.hibernate.engine.config.spi.StandardConverters.STRING;
import static org.hibernate.engine.jdbc.JdbcLogging.JDBC_MESSAGE_LOGGER;
import static org.hibernate.engine.jdbc.JdbcLogging.JDBC_LOGGER;
import static org.hibernate.engine.jdbc.env.internal.LobCreatorBuilderImpl.makeLobCreatorBuilder;

/**
Expand Down Expand Up @@ -117,7 +117,7 @@ private static IdentifierHelper identifierHelper(Dialect dialect, IdentifierHelp
}
catch (SQLException sqle) {
// should never ever happen
JDBC_MESSAGE_LOGGER.noDatabaseMetaData( sqle );
JDBC_LOGGER.noDatabaseMetaData( sqle );
}
return builder.build();
}
Expand Down Expand Up @@ -207,7 +207,7 @@ private IdentifierHelper identifierHelper(DatabaseMetaData databaseMetaData, Dia
}
catch (SQLException sqle) {
// should never ever happen
JDBC_MESSAGE_LOGGER.noDatabaseMetaData( sqle );
JDBC_LOGGER.noDatabaseMetaData( sqle );
}
return identifierHelperBuilder.build();
}
Expand Down Expand Up @@ -307,7 +307,7 @@ private IdentifierHelper identifierHelper(
}
catch (SQLException sqle) {
// should never ever happen
JDBC_MESSAGE_LOGGER.noDatabaseMetaData( sqle );
JDBC_LOGGER.noDatabaseMetaData( sqle );
}
return builder.build();
}
Expand Down Expand Up @@ -373,10 +373,10 @@ public LobCreatorBuilder getLobCreatorBuilder() {
private static void logJdbcFetchSize(int defaultFetchSize, ConfigurationService cfgService) {
if ( !cfgService.getSettings().containsKey( JdbcSettings.STATEMENT_FETCH_SIZE ) ) {
if ( defaultFetchSize > 0 && defaultFetchSize < 100 ) {
JDBC_MESSAGE_LOGGER.warnLowFetchSize( defaultFetchSize );
JDBC_LOGGER.warnLowFetchSize( defaultFetchSize );
}
else {
JDBC_MESSAGE_LOGGER.usingFetchSize( defaultFetchSize );
JDBC_LOGGER.usingFetchSize( defaultFetchSize );
}
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@
import org.hibernate.stat.spi.StatisticsImplementor;


import static org.hibernate.engine.jdbc.JdbcLogging.JDBC_MESSAGE_LOGGER;
import static org.hibernate.engine.jdbc.JdbcLogging.JDBC_LOGGER;

import static java.lang.Integer.parseInt;
import static org.hibernate.cfg.AvailableSettings.CONNECTION_HANDLING;
Expand Down Expand Up @@ -380,7 +380,7 @@ public JdbcEnvironmentImpl execute(Connection connection) {
);
}
catch (SQLException e) {
JDBC_MESSAGE_LOGGER.unableToObtainConnectionMetadata( e );
JDBC_LOGGER.unableToObtainConnectionMetadata( e );
}

// accessing the JDBC metadata failed
Expand Down Expand Up @@ -411,7 +411,7 @@ private int databaseMicroVersion(DatabaseMetaData metadata) throws SQLException
);
}
catch ( Exception e ) {
JDBC_MESSAGE_LOGGER.unableToObtainConnectionToQueryMetadata( e );
JDBC_LOGGER.unableToObtainConnectionToQueryMetadata( e );
}
finally {
//noinspection resource
Expand All @@ -422,14 +422,14 @@ private int databaseMicroVersion(DatabaseMetaData metadata) throws SQLException
}

private static void logDatabaseAndDriver(DatabaseMetaData dbmd) throws SQLException {
if ( JDBC_MESSAGE_LOGGER.isDebugEnabled() ) {
JDBC_MESSAGE_LOGGER.logDatabaseInfo(
if ( JDBC_LOGGER.isDebugEnabled() ) {
JDBC_LOGGER.logDatabaseInfo(
dbmd.getDatabaseProductName(),
dbmd.getDatabaseProductVersion(),
dbmd.getDatabaseMajorVersion(),
dbmd.getDatabaseMinorVersion()
);
JDBC_MESSAGE_LOGGER.logDriverInfo(
JDBC_LOGGER.logDriverInfo(
dbmd.getDriverName(),
dbmd.getDriverVersion(),
dbmd.getDriverMajorVersion(),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@
import java.util.function.Supplier;

import static org.hibernate.ConnectionReleaseMode.AFTER_STATEMENT;
import static org.hibernate.engine.jdbc.JdbcLogging.JDBC_MESSAGE_LOGGER;
import static org.hibernate.engine.jdbc.JdbcLogging.JDBC_LOGGER;
import static org.hibernate.engine.jdbc.batch.JdbcBatchLogging.BATCH_MESSAGE_LOGGER;

/**
Expand All @@ -46,7 +46,7 @@
* @author Sanne Grinovero
*/
public class JdbcCoordinatorImpl implements JdbcCoordinator {
private static final boolean TRACE_ENABLED = JDBC_MESSAGE_LOGGER.isTraceEnabled();
private static final boolean TRACE_ENABLED = JDBC_LOGGER.isTraceEnabled();

private transient final LogicalConnectionImplementor logicalConnection;
private transient final JdbcSessionOwner owner;
Expand Down Expand Up @@ -79,7 +79,7 @@ public JdbcCoordinatorImpl(
this.isUserSuppliedConnection = userSuppliedConnection != null;
this.logicalConnection = createLogicalConnection( userSuppliedConnection, owner );
if ( TRACE_ENABLED ) {
JDBC_MESSAGE_LOGGER.createdJdbcCoordinator( hashCode() );
JDBC_LOGGER.createdJdbcCoordinator( hashCode() );
}
}

Expand All @@ -102,7 +102,7 @@ private JdbcCoordinatorImpl(
this.owner = owner;
this.jdbcServices = owner.getJdbcSessionContext().getJdbcServices();
if ( TRACE_ENABLED ) {
JDBC_MESSAGE_LOGGER.createdJdbcCoordinator( hashCode() );
JDBC_LOGGER.createdJdbcCoordinator( hashCode() );
}
}

Expand Down Expand Up @@ -146,12 +146,12 @@ public void flushEnding() {
@Override
public Connection close() {
if ( TRACE_ENABLED ) {
JDBC_MESSAGE_LOGGER.closingJdbcCoordinator( hashCode() );
JDBC_LOGGER.closingJdbcCoordinator( hashCode() );
}
final Connection connection;
try {
if ( currentBatch != null ) {
JDBC_MESSAGE_LOGGER.closingUnreleasedBatch( hashCode() );
JDBC_LOGGER.closingUnreleasedBatch( hashCode() );
currentBatch.release();
currentBatch = null;
}
Expand Down Expand Up @@ -289,14 +289,14 @@ public int determineRemainingTransactionTimeOutPeriod() {
public void afterStatementExecution() {
final var connectionReleaseMode = connectionReleaseMode();
if ( TRACE_ENABLED ) {
JDBC_MESSAGE_LOGGER.statementExecutionComplete( connectionReleaseMode, hashCode() );
JDBC_LOGGER.statementExecutionComplete( connectionReleaseMode, hashCode() );
}
if ( connectionReleaseMode == AFTER_STATEMENT ) {
if ( ! releasesEnabled ) {
JDBC_MESSAGE_LOGGER.trace( "Skipping aggressive release due to manual disabling" );
JDBC_LOGGER.trace( "Skipping aggressive release due to manual disabling" );
}
else if ( hasRegisteredResources() ) {
JDBC_MESSAGE_LOGGER.trace( "Skipping aggressive release due to registered resources" );
JDBC_LOGGER.trace( "Skipping aggressive release due to registered resources" );
}
else {
getLogicalConnection().afterStatement();
Expand Down Expand Up @@ -397,15 +397,15 @@ public boolean isActive() {
@Override
public void afterTransactionBegin() {
if ( TRACE_ENABLED ) {
JDBC_MESSAGE_LOGGER.transactionAfterBegin( hashCode() );
JDBC_LOGGER.transactionAfterBegin( hashCode() );
}
owner.afterTransactionBegin();
}

@Override
public void beforeTransactionCompletion() {
if ( TRACE_ENABLED ) {
JDBC_MESSAGE_LOGGER.transactionBeforeCompletion( hashCode() );
JDBC_LOGGER.transactionBeforeCompletion( hashCode() );
}
owner.beforeTransactionCompletion();
logicalConnection.beforeTransactionCompletion();
Expand All @@ -414,7 +414,7 @@ public void beforeTransactionCompletion() {
@Override
public void afterTransactionCompletion(boolean successful, boolean delayed) {
if ( TRACE_ENABLED ) {
JDBC_MESSAGE_LOGGER.transactionAfterCompletion(
JDBC_LOGGER.transactionAfterCompletion(
successful ? "successful" : "unsuccessful",
hashCode() );
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@

import org.checkerframework.checker.nullness.qual.Nullable;

import static org.hibernate.engine.jdbc.JdbcLogging.JDBC_MESSAGE_LOGGER;
import static org.hibernate.engine.jdbc.JdbcLogging.JDBC_LOGGER;

/**
* Standard implementation of {@link StatementPreparer}.
Expand Down Expand Up @@ -224,18 +224,18 @@ public void postProcess(PreparedStatement preparedStatement) throws SQLException
private void setStatementFetchSize(PreparedStatement statement) throws SQLException {
final Integer fetchSize = settings().getFetchSizeOrNull();
if ( fetchSize != null ) {
JDBC_MESSAGE_LOGGER.settingFetchSize( fetchSize );
JDBC_LOGGER.settingFetchSize( fetchSize );
statement.setFetchSize( fetchSize );
}
else {
if ( JDBC_MESSAGE_LOGGER.isDebugEnabled() ) {
if ( JDBC_LOGGER.isDebugEnabled() ) {
final int defaultFetchSize = statement.getFetchSize();
if ( defaultFetchSize > 0 && defaultFetchSize < 100 ) {
JDBC_MESSAGE_LOGGER.lowFetchSize( defaultFetchSize );
JDBC_LOGGER.lowFetchSize( defaultFetchSize );
}
}
else if ( JDBC_MESSAGE_LOGGER.isTraceEnabled() ) {
JDBC_MESSAGE_LOGGER.fetchSize( statement.getFetchSize() );
else if ( JDBC_LOGGER.isTraceEnabled() ) {
JDBC_LOGGER.fetchSize( statement.getFetchSize() );
}
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@

import org.checkerframework.checker.nullness.qual.Nullable;

import static org.hibernate.internal.CoreMessageLogger.LOGGER;
import static org.hibernate.internal.CoreMessageLogger.CORE_LOGGER;

/**
* A strategy for determining if an identifier value is an identifier of
Expand All @@ -28,7 +28,7 @@ public class IdentifierValue implements UnsavedValueStrategy {
public static final IdentifierValue ANY = new IdentifierValue() {
@Override
public Boolean isUnsaved(Object id) {
LOGGER.trace( "ID unsaved-value strategy ANY" );
CORE_LOGGER.idUnsavedValueStrategy( "ANY" );
return Boolean.TRUE;
}

Expand All @@ -49,7 +49,7 @@ public String toString() {
public static final IdentifierValue NONE = new IdentifierValue() {
@Override
public Boolean isUnsaved(Object id) {
LOGGER.trace( "ID unsaved-value strategy NONE" );
CORE_LOGGER.idUnsavedValueStrategy( "NONE" );
return Boolean.FALSE;
}

Expand All @@ -71,7 +71,7 @@ public String toString() {
public static final IdentifierValue NULL = new IdentifierValue() {
@Override
public Boolean isUnsaved(@Nullable Object id) {
LOGGER.trace( "ID unsaved-value strategy NULL" );
CORE_LOGGER.idUnsavedValueStrategy( "NULL" );
return id == null;
}

Expand All @@ -92,7 +92,7 @@ public String toString() {
public static final IdentifierValue UNDEFINED = new IdentifierValue() {
@Override
public @Nullable Boolean isUnsaved(Object id) {
LOGGER.trace( "ID unsaved-value strategy UNDEFINED" );
CORE_LOGGER.idUnsavedValueStrategy( "UNDEFINED" );
return null;
}

Expand Down Expand Up @@ -124,7 +124,7 @@ public IdentifierValue(Object value) {
*/
@Override
public @Nullable Boolean isUnsaved(@Nullable Object id) {
LOGGER.tracef( "ID unsaved-value: %s", value );
CORE_LOGGER.idUnsavedValue( value );
return id == null || id.equals( value );
}

Expand Down
Loading
Loading