[JIRA] (HHH-17001) An "on"-clause referencing the affected join node causes a StackOverflowException
by ortwin.escher (JIRA)
ortwin.escher ( https://hibernate.atlassian.net/secure/ViewProfile.jspa?accountId=5e89d19... ) *created* an issue
Hibernate ORM ( https://hibernate.atlassian.net/browse/HHH?atlOrigin=eyJpIjoiYzMxYmQ1MGEw... ) / Bug ( https://hibernate.atlassian.net/browse/HHH-17001?atlOrigin=eyJpIjoiYzMxYm... ) HHH-17001 ( https://hibernate.atlassian.net/browse/HHH-17001?atlOrigin=eyJpIjoiYzMxYm... ) An "on"-clause referencing the affected join node causes a StackOverflowException ( https://hibernate.atlassian.net/browse/HHH-17001?atlOrigin=eyJpIjoiYzMxYm... )
Issue Type: Bug Affects Versions: 6.3.0.CR1 Assignee: Unassigned Attachments: hibernate-stackoverflowerror.zip Components: query-criteria Created: 26/Jul/2023 09:13 AM Priority: Major Reporter: ortwin.escher ( https://hibernate.atlassian.net/secure/ViewProfile.jspa?accountId=5e89d19... )
When referencing a join node in an “on”-clause the lookup of the join node causes a StackOverflowError. This worked in Hibernate 5 and blocks us from migrating to Hibernate 6.
A reproducer project is attached. I adapted the reproducer of https://hibernate.atlassian.net/browse/HHH-16968 to demonstrate the problem.
Example Stacktrace excerpt:
at org.hibernate.query.sqm.SemanticQueryWalker.visitSetJoin(SemanticQueryWalker.java:211) ~[hibernate-core-6.3.0.CR1.jar:6.3.0.CR1]
at org.hibernate.query.sqm.tree.domain.SqmSetJoin.accept(SqmSetJoin.java:85) ~[hibernate-core-6.3.0.CR1.jar:6.3.0.CR1]
at org.hibernate.query.sqm.tree.jpa.ParameterCollector.lambda$visitComparisonPredicate$14(ParameterCollector.java:272) ~[hibernate-core-6.3.0.CR1.jar:6.3.0.CR1]
at org.hibernate.query.sqm.tree.jpa.ParameterCollector.withTypeInference(ParameterCollector.java:147) ~[hibernate-core-6.3.0.CR1.jar:6.3.0.CR1]
at org.hibernate.query.sqm.tree.jpa.ParameterCollector.visitComparisonPredicate(ParameterCollector.java:272) ~[hibernate-core-6.3.0.CR1.jar:6.3.0.CR1]
at org.hibernate.query.sqm.tree.predicate.SqmComparisonPredicate.accept(SqmComparisonPredicate.java:104) ~[hibernate-core-6.3.0.CR1.jar:6.3.0.CR1]
at org.hibernate.query.sqm.spi.BaseSemanticQueryWalker.visitQualifiedAttributeJoin(BaseSemanticQueryWalker.java:296) ~[hibernate-core-6.3.0.CR1.jar:6.3.0.CR1]
at org.hibernate.query.sqm.SemanticQueryWalker.visitSetJoin(SemanticQueryWalker.java:211) ~[hibernate-core-6.3.0.CR1.jar:6.3.0.CR1]
at org.hibernate.query.sqm.tree.domain.SqmSetJoin.accept(SqmSetJoin.java:85) ~[hibernate-core-6.3.0.CR1.jar:6.3.0.CR1]
at org.hibernate.query.sqm.tree.jpa.ParameterCollector.lambda$visitComparisonPredicate$14(ParameterCollector.java:272) ~[hibernate-core-6.3.0.CR1.jar:6.3.0.CR1]
at org.hibernate.query.sqm.tree.jpa.ParameterCollector.withTypeInference(ParameterCollector.java:147) ~[hibernate-core-6.3.0.CR1.jar:6.3.0.CR1]
at org.hibernate.query.sqm.tree.jpa.ParameterCollector.visitComparisonPredicate(ParameterCollector.java:272) ~[hibernate-core-6.3.0.CR1.jar:6.3.0.CR1]
at org.hibernate.query.sqm.tree.predicate.SqmComparisonPredicate.accept(SqmComparisonPredicate.java:104) ~[hibernate-core-6.3.0.CR1.jar:6.3.0.CR1]
at org.hibernate.query.sqm.spi.BaseSemanticQueryWalker.visitQualifiedAttributeJoin(BaseSemanticQueryWalker.java:296) ~[hibernate-core-6.3.0.CR1.jar:6.3.0.CR1]
at org.hibernate.query.sqm.SemanticQueryWalker.visitSetJoin(SemanticQueryWalker.java:211) ~[hibernate-core-6.3.0.CR1.jar:6.3.0.CR1]
at org.hibernate.query.sqm.tree.domain.SqmSetJoin.accept(SqmSetJoin.java:85) ~[hibernate-core-6.3.0.CR1.jar:6.3.0.CR1]
at org.hibernate.query.sqm.tree.jpa.ParameterCollector.lambda$visitComparisonPredicate$14(ParameterCollector.java:272) ~[hibernate-core-6.3.0.CR1.jar:6.3.0.CR1]
at org.hibernate.query.sqm.tree.jpa.ParameterCollector.withTypeInference(ParameterCollector.java:147) ~[hibernate-core-6.3.0.CR1.jar:6.3.0.CR1]
at org.hibernate.query.sqm.tree.jpa.ParameterCollector.visitComparisonPredicate(ParameterCollector.java:272) ~[hibernate-core-6.3.0.CR1.jar:6.3.0.CR1]
at org.hibernate.query.sqm.tree.predicate.SqmComparisonPredicate.accept(SqmComparisonPredicate.java:104) ~[hibernate-core-6.3.0.CR1.jar:6.3.0.CR1]
at org.hibernate.query.sqm.spi.BaseSemanticQueryWalker.visitQualifiedAttributeJoin(BaseSemanticQueryWalker.java:296) ~[hibernate-core-6.3.0.CR1.jar:6.3.0.CR1]
at org.hibernate.query.sqm.SemanticQueryWalker.visitSetJoin(SemanticQueryWalker.java:211) ~[hibernate-core-6.3.0.CR1.jar:6.3.0.CR1]
at org.hibernate.query.sqm.tree.domain.SqmSetJoin.accept(SqmSetJoin.java:85) ~[hibernate-core-6.3.0.CR1.jar:6.3.0.CR1]
( https://hibernate.atlassian.net/browse/HHH-17001#add-comment?atlOrigin=ey... ) Add Comment ( https://hibernate.atlassian.net/browse/HHH-17001#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#100233- sha1:62cfdef )
2 years, 8 months
[JIRA] (HHH-17000) Do not keep static references to log levels
by Sanne Grinovero (JIRA)
Sanne Grinovero ( https://hibernate.atlassian.net/secure/ViewProfile.jspa?accountId=557058%... ) *commented* on HHH-17000 ( https://hibernate.atlassian.net/browse/HHH-17000?atlOrigin=eyJpIjoiOGQxYT... )
Re: Do not keep static references to log levels ( https://hibernate.atlassian.net/browse/HHH-17000?atlOrigin=eyJpIjoiOGQxYT... )
Hi James, this was a “convention” started at first by the Infinispan team, but then applied across several projects. There’s certainly tradeoffs, and perhaps it’s time to revisit them as I don’t know how much it’s applicable today, but this was intentional.
Essentially expressing it as a final constant has two benefits (which might be out of date):
* it helps code elimination in GraalVM
* the performance help in JVM - like you say, it’s extemely marginal but it has been show to exist, and in some cases it matters.
Now as it happens, both of the above points are highly contexctual, but we had some situations in which they did matter. The alternative to this pattern being to fully remove such statements from the source code.
Rather than fully removing it, we decided that we consider the “trace” level as something that is allowed to be folded as a constant. So I’d not consider it as a bug because if people want to “flip” this dynamically… if I remove such statements instead they won’t be able to log them at all. Perhaps JBoss Logger could address this need explicitly? As I see it, what puzzles our users most is that this “convention” isn’t advertised enough.
What we could do, if these are particularly useful, is to re-evaluate if they should be upgraded to debug. It wasn’t intention to fold as a constant anything at debug level, only for tracing.
( https://hibernate.atlassian.net/browse/HHH-17000#add-comment?atlOrigin=ey... ) Add Comment ( https://hibernate.atlassian.net/browse/HHH-17000#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#100233- sha1:62cfdef )
2 years, 8 months