[JIRA] (HHH-16267) ConcurrentModificationException: when initializing lazy one-to-many-collection
by Johannes Edmeier (JIRA)
Johannes Edmeier ( https://hibernate.atlassian.net/secure/ViewProfile.jspa?accountId=5d9b11b... ) *updated* an issue
Hibernate ORM ( https://hibernate.atlassian.net/browse/HHH?atlOrigin=eyJpIjoiYTI1NzExOTFi... ) / Bug ( https://hibernate.atlassian.net/browse/HHH-16267?atlOrigin=eyJpIjoiYTI1Nz... ) HHH-16267 ( https://hibernate.atlassian.net/browse/HHH-16267?atlOrigin=eyJpIjoiYTI1Nz... ) ConcurrentModificationException: when initializing lazy one-to-many-collection ( https://hibernate.atlassian.net/browse/HHH-16267?atlOrigin=eyJpIjoiYTI1Nz... )
Change By: Johannes Edmeier ( https://hibernate.atlassian.net/secure/ViewProfile.jspa?accountId=5d9b11b... )
We experienced a CME when initilizing a lazy one-to-many.
{noformat}java.util.ConcurrentModificationException: null
at java.base/java.util.ArrayList$Itr.checkForComodification(ArrayList.java:1013)
at java.base/java.util.ArrayList$Itr.next(ArrayList.java:967)
at org.hibernate.sql.ast.spi.AbstractSqlAstTranslator.visitAnsiCaseSearchedExpression(AbstractSqlAstTranslator.java:4858)
at org.hibernate.sql.ast.spi.AbstractSqlAstTranslator.visitCaseSearchedExpression(AbstractSqlAstTranslator.java:4849)
at org.hibernate.sql.ast.spi.AbstractSqlAstTranslator.visitCaseSearchedExpression(AbstractSqlAstTranslator.java:4841)
at org.hibernate.sql.ast.tree.expression.CaseSearchedExpression.accept(CaseSearchedExpression.java:99)
at org.hibernate.metamodel.mapping.internal.CaseStatementDiscriminatorMappingImpl$1.renderToSql(CaseStatementDiscriminatorMappingImpl.java:168)
at org.hibernate.sql.ast.spi.AbstractSqlAstTranslator.visitSelfRenderingExpression(AbstractSqlAstTranslator.java:5072)
at org.hibernate.sql.ast.tree.expression.SelfRenderingExpression.accept(SelfRenderingExpression.java:20)
at org.hibernate.dialect.PostgreSQLSqlAstTranslator.renderExpressionAsClauseItem(PostgreSQLSqlAstTranslator.java:38)
at org.hibernate.sql.ast.spi.AbstractSqlAstTranslator.renderSelectExpression(AbstractSqlAstTranslator.java:3616)
at org.hibernate.sql.ast.spi.AbstractSqlAstTranslator.visitSqlSelectExpression(AbstractSqlAstTranslator.java:3585)
at org.hibernate.sql.ast.spi.AbstractSqlAstTranslator.visitSqlSelection(AbstractSqlAstTranslator.java:3567)
at org.hibernate.sql.ast.spi.AbstractSqlAstTranslator.visitSqlSelections(AbstractSqlAstTranslator.java:3217)
at org.hibernate.sql.ast.spi.AbstractSqlAstTranslator.visitSelectClause(AbstractSqlAstTranslator.java:3135)
at org.hibernate.sql.ast.spi.AbstractSqlAstTranslator.visitQuerySpec(AbstractSqlAstTranslator.java:1603)
at org.hibernate.dialect.PostgreSQLSqlAstTranslator.visitQuerySpec(PostgreSQLSqlAstTranslator.java:103)
at org.hibernate.sql.ast.tree.select.QuerySpec.accept(QuerySpec.java:129)
at org.hibernate.sql.ast.spi.AbstractSqlAstTranslator.visitSelectStatement(AbstractSqlAstTranslator.java:837)
at org.hibernate.sql.ast.spi.AbstractSqlAstTranslator.translateSelect(AbstractSqlAstTranslator.java:707)
at org.hibernate.sql.ast.spi.AbstractSqlAstTranslator.translate(AbstractSqlAstTranslator.java:645)
at org.hibernate.loader.ast.internal.CollectionLoaderSingleKey.load(CollectionLoaderSingleKey.java:112)
at org.hibernate.persister.collection.AbstractCollectionPersister.initialize(AbstractCollectionPersister.java:789)
at org.hibernate.event.internal.DefaultInitializeCollectionEventListener.onInitializeCollection(DefaultInitializeCollectionEventListener.java:75)
at org.hibernate.event.service.internal.EventListenerGroupImpl.fireEventOnEachListener(EventListenerGroupImpl.java:107)
at org.hibernate.internal.SessionImpl.initializeCollection(SessionImpl.java:1710)
at org.hibernate.collection.spi.AbstractPersistentCollection.lambda$initialize$3(AbstractPersistentCollection.java:617)
at org.hibernate.collection.spi.AbstractPersistentCollection.withTemporarySessionIfNeeded(AbstractPersistentCollection.java:265)
at org.hibernate.collection.spi.AbstractPersistentCollection.initialize(AbstractPersistentCollection.java:615)
at org.hibernate.collection.spi.AbstractPersistentCollection.read(AbstractPersistentCollection.java:136)
at org.hibernate.collection.spi.PersistentList.iterator(PersistentList.java:168)
at java.base/java.util.Spliterators$IteratorSpliterator.estimateSize(Spliterators.java:1865)
at java.base/java.util.Spliterator.getExactSizeIfKnown(Spliterator.java:414)
at java.base/java.util.stream.AbstractPipeline.copyInto(AbstractPipeline.java:508)
at java.base/java.util.stream.AbstractPipeline.wrapAndCopyInto(AbstractPipeline.java:499)
at java.base/java.util.stream.ReduceOps$ReduceOp.evaluateSequential(ReduceOps.java:921)
at java.base/java.util.stream.AbstractPipeline.evaluate(AbstractPipeline.java:234)
at java.base/java.util.stream.ReferencePipeline.collect(ReferencePipeline.java:682)
... {noformat}
( https://hibernate.atlassian.net/browse/HHH-16267#add-comment?atlOrigin=ey... ) Add Comment ( https://hibernate.atlassian.net/browse/HHH-16267#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=EmailN... ) This message was sent by Atlassian Jira (v1001.0.0-SNAPSHOT#100217- sha1:c17c655 )
1 year, 10 months
[JIRA] (HHH-16267) ConcurrentModificationException: when initializing lazy one-to-many-collection
by Johannes Edmeier (JIRA)
Johannes Edmeier ( https://hibernate.atlassian.net/secure/ViewProfile.jspa?accountId=5d9b11b... ) *created* an issue
Hibernate ORM ( https://hibernate.atlassian.net/browse/HHH?atlOrigin=eyJpIjoiODkyMDVjYzIz... ) / Bug ( https://hibernate.atlassian.net/browse/HHH-16267?atlOrigin=eyJpIjoiODkyMD... ) HHH-16267 ( https://hibernate.atlassian.net/browse/HHH-16267?atlOrigin=eyJpIjoiODkyMD... ) ConcurrentModificationException: when initializing lazy one-to-many-collection ( https://hibernate.atlassian.net/browse/HHH-16267?atlOrigin=eyJpIjoiODkyMD... )
Issue Type: Bug Affects Versions: 6.1.7 Assignee: Unassigned Created: 08/Mar/2023 02:49 AM Priority: Major Reporter: Johannes Edmeier ( https://hibernate.atlassian.net/secure/ViewProfile.jspa?accountId=5d9b11b... )
We experienced a CME when initilizing a lazy one-to-many.
java.util.ConcurrentModificationException: null
at java.base/java.util.ArrayList$Itr.checkForComodification(ArrayList.java:1013)
at java.base/java.util.ArrayList$Itr.next(ArrayList.java:967)
at org.hibernate.sql.ast.spi.AbstractSqlAstTranslator.visitAnsiCaseSearchedExpression(AbstractSqlAstTranslator.java:4858)
at org.hibernate.sql.ast.spi.AbstractSqlAstTranslator.visitCaseSearchedExpression(AbstractSqlAstTranslator.java:4849)
at org.hibernate.sql.ast.spi.AbstractSqlAstTranslator.visitCaseSearchedExpression(AbstractSqlAstTranslator.java:4841)
at org.hibernate.sql.ast.tree.expression.CaseSearchedExpression.accept(CaseSearchedExpression.java:99)
at org.hibernate.metamodel.mapping.internal.CaseStatementDiscriminatorMappingImpl$1.renderToSql(CaseStatementDiscriminatorMappingImpl.java:168)
at org.hibernate.sql.ast.spi.AbstractSqlAstTranslator.visitSelfRenderingExpression(AbstractSqlAstTranslator.java:5072)
at org.hibernate.sql.ast.tree.expression.SelfRenderingExpression.accept(SelfRenderingExpression.java:20)
at org.hibernate.dialect.PostgreSQLSqlAstTranslator.renderExpressionAsClauseItem(PostgreSQLSqlAstTranslator.java:38)
at org.hibernate.sql.ast.spi.AbstractSqlAstTranslator.renderSelectExpression(AbstractSqlAstTranslator.java:3616)
at org.hibernate.sql.ast.spi.AbstractSqlAstTranslator.visitSqlSelectExpression(AbstractSqlAstTranslator.java:3585)
at org.hibernate.sql.ast.spi.AbstractSqlAstTranslator.visitSqlSelection(AbstractSqlAstTranslator.java:3567)
at org.hibernate.sql.ast.spi.AbstractSqlAstTranslator.visitSqlSelections(AbstractSqlAstTranslator.java:3217)
at org.hibernate.sql.ast.spi.AbstractSqlAstTranslator.visitSelectClause(AbstractSqlAstTranslator.java:3135)
at org.hibernate.sql.ast.spi.AbstractSqlAstTranslator.visitQuerySpec(AbstractSqlAstTranslator.java:1603)
at org.hibernate.dialect.PostgreSQLSqlAstTranslator.visitQuerySpec(PostgreSQLSqlAstTranslator.java:103)
at org.hibernate.sql.ast.tree.select.QuerySpec.accept(QuerySpec.java:129)
at org.hibernate.sql.ast.spi.AbstractSqlAstTranslator.visitSelectStatement(AbstractSqlAstTranslator.java:837)
at org.hibernate.sql.ast.spi.AbstractSqlAstTranslator.translateSelect(AbstractSqlAstTranslator.java:707)
at org.hibernate.sql.ast.spi.AbstractSqlAstTranslator.translate(AbstractSqlAstTranslator.java:645)
at org.hibernate.loader.ast.internal.CollectionLoaderSingleKey.load(CollectionLoaderSingleKey.java:112)
at org.hibernate.persister.collection.AbstractCollectionPersister.initialize(AbstractCollectionPersister.java:789)
at org.hibernate.event.internal.DefaultInitializeCollectionEventListener.onInitializeCollection(DefaultInitializeCollectionEventListener.java:75)
at org.hibernate.event.service.internal.EventListenerGroupImpl.fireEventOnEachListener(EventListenerGroupImpl.java:107)
at org.hibernate.internal.SessionImpl.initializeCollection(SessionImpl.java:1710)
at org.hibernate.collection.spi.AbstractPersistentCollection.lambda$initialize$3(AbstractPersistentCollection.java:617)
at org.hibernate.collection.spi.AbstractPersistentCollection.withTemporarySessionIfNeeded(AbstractPersistentCollection.java:265)
at org.hibernate.collection.spi.AbstractPersistentCollection.initialize(AbstractPersistentCollection.java:615)
at org.hibernate.collection.spi.AbstractPersistentCollection.read(AbstractPersistentCollection.java:136)
at org.hibernate.collection.spi.PersistentList.iterator(PersistentList.java:168)
at java.base/java.util.Spliterators$IteratorSpliterator.estimateSize(Spliterators.java:1865)
at java.base/java.util.Spliterator.getExactSizeIfKnown(Spliterator.java:414)
at java.base/java.util.stream.AbstractPipeline.copyInto(AbstractPipeline.java:508)
at java.base/java.util.stream.AbstractPipeline.wrapAndCopyInto(AbstractPipeline.java:499)
at java.base/java.util.stream.ReduceOps$ReduceOp.evaluateSequential(ReduceOps.java:921)
at java.base/java.util.stream.AbstractPipeline.evaluate(AbstractPipeline.java:234)
at java.base/java.util.stream.ReferencePipeline.collect(ReferencePipeline.java:682)
( https://hibernate.atlassian.net/browse/HHH-16267#add-comment?atlOrigin=ey... ) Add Comment ( https://hibernate.atlassian.net/browse/HHH-16267#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=EmailN... ) This message was sent by Atlassian Jira (v1001.0.0-SNAPSHOT#100217- sha1:c17c655 )
1 year, 10 months