Skip to content

Commit 709ac03

Browse files
committed
Drop TypeConfigurationRegistry which was leaking session factories that had a bootstrap error
As far as I can tell, the purpose of TypeConfigurationRegistry was only for serialization, but since the TypeConfiguration UUID is always random, this won't work anyway.
1 parent ffe45cc commit 709ac03

File tree

2 files changed

+0
-73
lines changed

2 files changed

+0
-73
lines changed

hibernate-core/src/main/java/org/hibernate/type/internal/TypeConfigurationRegistry.java

Lines changed: 0 additions & 60 deletions
This file was deleted.

hibernate-core/src/main/java/org/hibernate/type/spi/TypeConfiguration.java

Lines changed: 0 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,6 @@
3737
import org.hibernate.type.TypeResolver;
3838
import org.hibernate.type.descriptor.java.spi.JavaTypeDescriptorRegistry;
3939
import org.hibernate.type.descriptor.sql.spi.SqlTypeDescriptorRegistry;
40-
import org.hibernate.type.internal.TypeConfigurationRegistry;
4140

4241
import static org.hibernate.internal.CoreLogging.messageLogger;
4342

@@ -88,8 +87,6 @@ public TypeConfiguration() {
8887
this.basicTypeRegistry = new BasicTypeRegistry();
8988
this.typeFactory = new TypeFactory( this );
9089
this.typeResolver = new TypeResolver( this, typeFactory );
91-
92-
TypeConfigurationRegistry.INSTANCE.registerTypeConfiguration( this );
9390
}
9491

9592
public String getUuid() {
@@ -210,8 +207,6 @@ public void sessionFactoryCreated(SessionFactory factory) {
210207
public void sessionFactoryClosed(SessionFactory factory) {
211208
log.tracef( "Handling #sessionFactoryClosed from [%s] for TypeConfiguration", factory );
212209

213-
TypeConfigurationRegistry.INSTANCE.deregisterTypeConfiguration( this );
214-
215210
scope.unsetSessionFactory( factory );
216211

217212
// todo (6.0) : finish this
@@ -374,12 +369,4 @@ private Object readResolve() throws InvalidObjectException {
374369
}
375370
}
376371

377-
378-
// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
379-
// Custom serialization hook
380-
381-
private Object readResolve() throws InvalidObjectException {
382-
log.trace( "Resolving serialized TypeConfiguration - readResolve" );
383-
return TypeConfigurationRegistry.INSTANCE.findTypeConfiguration( getUuid() );
384-
}
385372
}

0 commit comments

Comments
 (0)