Jeremy Whiting (
https://hibernate.atlassian.net/secure/ViewProfile.jspa?accountId=557058%...
) *commented* on HHH-15856 (
https://hibernate.atlassian.net/browse/HHH-15856?atlOrigin=eyJpIjoiNGIzMG...
)
Re: Secondary super-type cache contention mitigations (continued). (
https://hibernate.atlassian.net/browse/HHH-15856?atlOrigin=eyJpIjoiNGIzMG...
)
Using the type pollution agent tool the following is a fragment from the report.
------------------------------------------------------------
1: org.hibernate.persister.entity.SingleTableEntityPersister
------------------------------------------------------------
Count: 183959974
Types:
org.hibernate.persister.entity.EntityPersister
org.hibernate.metamodel.mapping.EntityMappingType
org.hibernate.persister.entity.Loadable
org.hibernate.bytecode.enhance.spi.LazyPropertyInitializer
org.hibernate.persister.entity.UniqueKeyLoadable
org.hibernate.metamodel.mapping.internal.InFlightEntityMappingType
org.hibernate.persister.entity.Joinable
org.hibernate.metamodel.mapping.Restrictable
org.hibernate.persister.entity.Queryable
org.hibernate.persister.entity.PropertyMapping
org.hibernate.metamodel.mapping.EntityValuedModelPart
org.hibernate.metamodel.mapping.ModelPartContainer
Traces:
org.hibernate.sql.results.graph.entity.AbstractEntityInitializer.<init>(AbstractEntityInitializer.java:199)
class: org.hibernate.metamodel.mapping.EntityMappingType
count: 71378712
org.hibernate.metamodel.model.domain.internal.MappingMetamodelImpl.getEntityDescriptor(MappingMetamodelImpl.java:414)
class: org.hibernate.persister.entity.EntityPersister
count: 46099450
org.hibernate.sql.results.jdbc.internal.JdbcValuesSourceProcessingStateStandardImpl.lambda$postLoad$0(JdbcValuesSourceProcessingStateStandardImpl.java:218)
class: org.hibernate.persister.entity.Loadable
count: 20745931
org.hibernate.sql.results.graph.entity.AbstractEntityInitializer.<init>(AbstractEntityInitializer.java:120)
class: org.hibernate.persister.entity.EntityPersister
count: 17322845
org.hibernate.metamodel.model.domain.internal.MappingMetamodelImpl.getEntityDescriptor(MappingMetamodelImpl.java:457)
class: org.hibernate.persister.entity.EntityPersister
count: 12592327
org.hibernate.bytecode.enhance.spi.interceptor.LazyAttributeLoadingInterceptor.lambda$loadAttribute$0(LazyAttributeLoadingInterceptor.java:111)
class: org.hibernate.bytecode.enhance.spi.LazyPropertyInitializer
count: 5096164
org.hibernate.metamodel.model.domain.internal.MappingMetamodelImpl.findEntityDescriptor(MappingMetamodelImpl.java:437)
class: org.hibernate.persister.entity.EntityPersister
count: 3657837
org.hibernate.sql.results.graph.Initializer.isAttributeAssignableToConcreteDescriptor(Initializer.java:84)
class: org.hibernate.persister.entity.EntityPersister
count: 3548875
org.hibernate.engine.internal.AbstractEntityEntry.overwriteLoadedStateCollectionValue(AbstractEntityEntry.java:321)
class: org.hibernate.persister.entity.UniqueKeyLoadable
count: 1963743
org.hibernate.sql.results.graph.entity.AbstractEntityInitializer.<init>(AbstractEntityInitializer.java:176)
class: org.hibernate.metamodel.mapping.EntityMappingType
count: 1245029
org.hibernate.sql.results.graph.entity.AbstractEntityInitializer.<init>(AbstractEntityInitializer.java:201)
class: org.hibernate.metamodel.mapping.EntityMappingType
count: 308768
org.hibernate.sql.results.graph.FetchParent.resolveNavigablePath(FetchParent.java:51)
class: org.hibernate.metamodel.mapping.EntityMappingType
count: 61
org.hibernate.loader.ast.internal.LoaderSelectBuilder.generateSelect(LoaderSelectBuilder.java:482)
class: org.hibernate.metamodel.mapping.Restrictable
count: 21
org.hibernate.metamodel.mapping.internal.MappingModelCreationProcess.execute(MappingModelCreationProcess.java:85)
class: org.hibernate.metamodel.mapping.internal.InFlightEntityMappingType
count: 19
org.hibernate.metamodel.mapping.internal.MappingModelCreationProcess.execute(MappingModelCreationProcess.java:76)
class: org.hibernate.persister.entity.EntityPersister
count: 18
org.hibernate.type.EntityType.getAssociatedJoinable(EntityType.java:196)
class: org.hibernate.persister.entity.Joinable
count: 18
org.hibernate.metamodel.mapping.internal.MappingModelCreationProcess.execute(MappingModelCreationProcess.java:77)
class: org.hibernate.metamodel.mapping.internal.InFlightEntityMappingType
count: 18
org.hibernate.metamodel.mapping.internal.MappingModelCreationProcess.getEntityPersister(MappingModelCreationProcess.java:65)
class: org.hibernate.persister.entity.EntityPersister
count: 17
org.hibernate.loader.ast.internal.SingleIdEntityLoaderStandardImpl.createLoadPlan(SingleIdEntityLoaderStandardImpl.java:194)
class: org.hibernate.persister.entity.Loadable
count: 17
org.hibernate.metamodel.model.domain.internal.EntityTypeImpl.<init>(EntityTypeImpl.java:68)
class: org.hibernate.persister.entity.Queryable
count: 13
org.hibernate.metamodel.model.domain.internal.MappingMetamodelImpl.finishInitialization(MappingMetamodelImpl.java:235)
class: org.hibernate.persister.entity.EntityPersister
count: 12
org.hibernate.metamodel.mapping.internal.MappingModelCreationProcess.execute(MappingModelCreationProcess.java:82)
class: org.hibernate.persister.entity.EntityPersister
count: 11
org.hibernate.persister.collection.AbstractCollectionPersister.applyWhereRestrictions(AbstractCollectionPersister.java:1805)
class: org.hibernate.persister.entity.Joinable
count: 11
org.hibernate.metamodel.mapping.internal.FetchOptionsHelper.determineFetchStyleByMetadata(FetchOptionsHelper.java:52)
class: org.hibernate.persister.entity.EntityPersister
count: 9
org.hibernate.metamodel.mapping.internal.FetchOptionsHelper.isSubsequentSelectDelayed(FetchOptionsHelper.java:124)
class: org.hibernate.persister.entity.EntityPersister
count: 9
org.hibernate.persister.collection.OneToManyPersister.getTableName(OneToManyPersister.java:496)
class: org.hibernate.persister.entity.Joinable
count: 8
org.hibernate.query.sqm.sql.BaseSqmToSqlAstConverter.visitTableGroup(BaseSqmToSqlAstConverter.java:3479)
class: org.hibernate.metamodel.mapping.EntityValuedModelPart
count: 6
org.hibernate.metamodel.mapping.internal.MappingModelCreationHelper.interpretPluralAttributeMappingKeyDescriptor(MappingModelCreationHelper.java:779)
class: org.hibernate.metamodel.mapping.ModelPartContainer
count: 5
org.hibernate.metamodel.mapping.internal.EntityCollectionPart.<init>(EntityCollectionPart.java:185)
class: org.hibernate.persister.entity.PropertyMapping
count: 4
org.hibernate.persister.internal.PersisterFactoryImpl.createEntityPersister(PersisterFactoryImpl.java:92)
class: org.hibernate.persister.entity.EntityPersister
count: 4
org.hibernate.persister.collection.AbstractCollectionPersister.applyWhereRestrictions(AbstractCollectionPersister.java:1806)
class: org.hibernate.persister.entity.Joinable
count: 3
org.hibernate.persister.collection.AbstractCollectionPersister.<init>(AbstractCollectionPersister.java:620)
class: org.hibernate.persister.entity.PropertyMapping
count: 3
org.hibernate.persister.entity.AbstractEntityPersister.visitSubTypeAttributeMappings(AbstractEntityPersister.java:6843)
class: org.hibernate.metamodel.mapping.EntityMappingType
count: 1
org.hibernate.metamodel.mapping.internal.MappingModelCreationProcess.execute(MappingModelCreationProcess.java:78)
class: org.hibernate.metamodel.mapping.internal.InFlightEntityMappingType
count: 1
org.hibernate.metamodel.mapping.internal.ToOneAttributeMapping.getReferencedNavigablePath(ToOneAttributeMapping.java:1166)
class: org.hibernate.metamodel.mapping.EntityMappingType
count: 1
org.hibernate.persister.entity.AbstractEntityPersister.linkWithSuperType(AbstractEntityPersister.java:6086)
class: org.hibernate.metamodel.mapping.internal.InFlightEntityMappingType
count: 1
org.hibernate.persister.entity.AbstractEntityPersister.getStateArrayInitialPosition(AbstractEntityPersister.java:5990)
class: org.hibernate.metamodel.mapping.internal.InFlightEntityMappingType
count: 1
org.hibernate.sql.results.graph.FetchParent.resolveNavigablePath(FetchParent.java:52)
class: org.hibernate.metamodel.mapping.EntityMappingType
count: 1
It revels the type SingleTableEntityPersister is being type cast. The types listed with
it’s ocurance.
The purpose of a PR is to remove the explicit type casts or instanceof checks. Thus
avoiding writing to a contended field.
By adding a default at the ancestor instance that returns a reference of the desired type
the cast can be avoided.
(
https://hibernate.atlassian.net/browse/HHH-15856#add-comment?atlOrigin=ey...
) Add Comment (
https://hibernate.atlassian.net/browse/HHH-15856#add-comment?atlOrigin=ey...
)
Get Jira notifications on your phone! Download the Jira Cloud app for Android (
https://play.google.com/store/apps/details?id=com.atlassian.android.jira....
) or iOS (
https://itunes.apple.com/app/apple-store/id1006972087?pt=696495&ct=Em...
) This message was sent by Atlassian Jira (v1001.0.0-SNAPSHOT#100214- sha1:02c55de )