From ad30a88857fb33a14a885e7d3f6e237bd162ceb3 Mon Sep 17 00:00:00 2001 From: Sanne Grinovero Date: Thu, 28 Oct 2021 14:02:10 +0100 Subject: [PATCH] Hibernate ORM: switch to the slightly more optimised UnmodifiableBatchBuilderInitiator --- .../boot/registry/PreconfiguredServiceRegistryBuilder.java | 6 ++++-- .../service/StandardHibernateORMInitiatorListProvider.java | 6 ++++-- .../PreconfiguredReactiveServiceRegistryBuilder.java | 5 +++-- .../registry/ReactiveHibernateInitiatorListProvider.java | 5 +++-- 4 files changed, 14 insertions(+), 8 deletions(-) diff --git a/extensions/hibernate-orm/runtime/src/main/java/io/quarkus/hibernate/orm/runtime/boot/registry/PreconfiguredServiceRegistryBuilder.java b/extensions/hibernate-orm/runtime/src/main/java/io/quarkus/hibernate/orm/runtime/boot/registry/PreconfiguredServiceRegistryBuilder.java index c90ac314b263a..772e3e61345cd 100644 --- a/extensions/hibernate-orm/runtime/src/main/java/io/quarkus/hibernate/orm/runtime/boot/registry/PreconfiguredServiceRegistryBuilder.java +++ b/extensions/hibernate-orm/runtime/src/main/java/io/quarkus/hibernate/orm/runtime/boot/registry/PreconfiguredServiceRegistryBuilder.java @@ -12,7 +12,7 @@ import org.hibernate.boot.registry.internal.StandardServiceRegistryImpl; import org.hibernate.boot.registry.selector.internal.StrategySelectorImpl; import org.hibernate.engine.config.internal.ConfigurationServiceInitiator; -import org.hibernate.engine.jdbc.batch.internal.BatchBuilderInitiator; +import org.hibernate.engine.jdbc.batch.internal.UnmodifiableBatchBuilderInitiator; import org.hibernate.engine.jdbc.connections.internal.MultiTenantConnectionProviderInitiator; import org.hibernate.engine.jdbc.cursor.internal.RefCursorSupportInitiator; import org.hibernate.engine.jdbc.env.internal.JdbcEnvironmentInitiator; @@ -190,7 +190,9 @@ private static List buildQuarkusServiceInitiatorList(R // Custom one: Dialect is injected explicitly serviceInitiators.add(new QuarkusStaticDialectFactoryInitiator(rs.getDialect())); - serviceInitiators.add(BatchBuilderInitiator.INSTANCE); + // Non-default implementation: optimised for lack of JMX management + serviceInitiators.add(UnmodifiableBatchBuilderInitiator.INSTANCE); + serviceInitiators.add(JdbcServicesInitiator.INSTANCE); serviceInitiators.add(RefCursorSupportInitiator.INSTANCE); diff --git a/extensions/hibernate-orm/runtime/src/main/java/io/quarkus/hibernate/orm/runtime/service/StandardHibernateORMInitiatorListProvider.java b/extensions/hibernate-orm/runtime/src/main/java/io/quarkus/hibernate/orm/runtime/service/StandardHibernateORMInitiatorListProvider.java index 8f1cf44e46ce6..a44751211b5e4 100644 --- a/extensions/hibernate-orm/runtime/src/main/java/io/quarkus/hibernate/orm/runtime/service/StandardHibernateORMInitiatorListProvider.java +++ b/extensions/hibernate-orm/runtime/src/main/java/io/quarkus/hibernate/orm/runtime/service/StandardHibernateORMInitiatorListProvider.java @@ -6,7 +6,7 @@ import org.hibernate.boot.cfgxml.internal.CfgXmlAccessServiceInitiator; import org.hibernate.boot.registry.StandardServiceInitiator; import org.hibernate.engine.config.internal.ConfigurationServiceInitiator; -import org.hibernate.engine.jdbc.batch.internal.BatchBuilderInitiator; +import org.hibernate.engine.jdbc.batch.internal.UnmodifiableBatchBuilderInitiator; import org.hibernate.engine.jdbc.connections.internal.MultiTenantConnectionProviderInitiator; import org.hibernate.engine.jdbc.cursor.internal.RefCursorSupportInitiator; import org.hibernate.engine.jdbc.dialect.internal.DialectResolverInitiator; @@ -75,7 +75,9 @@ public List initialInitiatorList() { // Custom one! serviceInitiators.add(DialectFactoryInitiator.INSTANCE); - serviceInitiators.add(BatchBuilderInitiator.INSTANCE); + + // Non-default implementation: optimised for lack of JMX management + serviceInitiators.add(UnmodifiableBatchBuilderInitiator.INSTANCE); serviceInitiators.add(JdbcServicesInitiator.INSTANCE); serviceInitiators.add(RefCursorSupportInitiator.INSTANCE); diff --git a/extensions/hibernate-reactive/runtime/src/main/java/io/quarkus/hibernate/reactive/runtime/boot/registry/PreconfiguredReactiveServiceRegistryBuilder.java b/extensions/hibernate-reactive/runtime/src/main/java/io/quarkus/hibernate/reactive/runtime/boot/registry/PreconfiguredReactiveServiceRegistryBuilder.java index 7e9300d0d6888..1d9e4255e1cdb 100644 --- a/extensions/hibernate-reactive/runtime/src/main/java/io/quarkus/hibernate/reactive/runtime/boot/registry/PreconfiguredReactiveServiceRegistryBuilder.java +++ b/extensions/hibernate-reactive/runtime/src/main/java/io/quarkus/hibernate/reactive/runtime/boot/registry/PreconfiguredReactiveServiceRegistryBuilder.java @@ -12,7 +12,7 @@ import org.hibernate.boot.registry.internal.StandardServiceRegistryImpl; import org.hibernate.boot.registry.selector.internal.StrategySelectorImpl; import org.hibernate.engine.config.internal.ConfigurationServiceInitiator; -import org.hibernate.engine.jdbc.batch.internal.BatchBuilderInitiator; +import org.hibernate.engine.jdbc.batch.internal.UnmodifiableBatchBuilderInitiator; import org.hibernate.engine.jdbc.connections.internal.MultiTenantConnectionProviderInitiator; import org.hibernate.engine.jdbc.cursor.internal.RefCursorSupportInitiator; import org.hibernate.engine.jdbc.internal.JdbcServicesInitiator; @@ -189,7 +189,8 @@ private static List buildQuarkusServiceInitiatorList(R // Disabled: Dialect is injected explicitly // serviceInitiators.add( DialectFactoryInitiator.INSTANCE ); - serviceInitiators.add(BatchBuilderInitiator.INSTANCE); + // Non-default implementation: optimised for lack of JMX management + serviceInitiators.add(UnmodifiableBatchBuilderInitiator.INSTANCE); serviceInitiators.add(JdbcServicesInitiator.INSTANCE); serviceInitiators.add(RefCursorSupportInitiator.INSTANCE); diff --git a/extensions/hibernate-reactive/runtime/src/main/java/io/quarkus/hibernate/reactive/runtime/boot/registry/ReactiveHibernateInitiatorListProvider.java b/extensions/hibernate-reactive/runtime/src/main/java/io/quarkus/hibernate/reactive/runtime/boot/registry/ReactiveHibernateInitiatorListProvider.java index a1ffcaeaa4f2c..0dd0e4d84633d 100644 --- a/extensions/hibernate-reactive/runtime/src/main/java/io/quarkus/hibernate/reactive/runtime/boot/registry/ReactiveHibernateInitiatorListProvider.java +++ b/extensions/hibernate-reactive/runtime/src/main/java/io/quarkus/hibernate/reactive/runtime/boot/registry/ReactiveHibernateInitiatorListProvider.java @@ -6,7 +6,7 @@ import org.hibernate.boot.cfgxml.internal.CfgXmlAccessServiceInitiator; import org.hibernate.boot.registry.StandardServiceInitiator; import org.hibernate.engine.config.internal.ConfigurationServiceInitiator; -import org.hibernate.engine.jdbc.batch.internal.BatchBuilderInitiator; +import org.hibernate.engine.jdbc.batch.internal.UnmodifiableBatchBuilderInitiator; import org.hibernate.engine.jdbc.connections.internal.MultiTenantConnectionProviderInitiator; import org.hibernate.engine.jdbc.cursor.internal.RefCursorSupportInitiator; import org.hibernate.engine.jdbc.dialect.internal.DialectResolverInitiator; @@ -87,7 +87,8 @@ public List initialInitiatorList() { // Custom Quarkus implementation ! serviceInitiators.add(DialectFactoryInitiator.INSTANCE); - serviceInitiators.add(BatchBuilderInitiator.INSTANCE); + // Non-default implementation: optimised for lack of JMX management + serviceInitiators.add(UnmodifiableBatchBuilderInitiator.INSTANCE); serviceInitiators.add(JdbcServicesInitiator.INSTANCE); serviceInitiators.add(RefCursorSupportInitiator.INSTANCE);