[JIRA] (HSEARCH-4804) Fix flaky test OutboxPollingAutomaticIndexingLifecycleIT with postgresql
by Yoann Rodière (JIRA)
Yoann Rodière ( https://hibernate.atlassian.net/secure/ViewProfile.jspa?accountId=557058%... ) *created* an issue
Hibernate Search ( https://hibernate.atlassian.net/browse/HSEARCH?atlOrigin=eyJpIjoiOWI1ZDZj... ) / Task ( https://hibernate.atlassian.net/browse/HSEARCH-4804?atlOrigin=eyJpIjoiOWI... ) HSEARCH-4804 ( https://hibernate.atlassian.net/browse/HSEARCH-4804?atlOrigin=eyJpIjoiOWI... ) Fix flaky test OutboxPollingAutomaticIndexingLifecycleIT with postgresql ( https://hibernate.atlassian.net/browse/HSEARCH-4804?atlOrigin=eyJpIjoiOWI... )
Issue Type: Task Affects Versions: 6.2.0.Alpha2 Assignee: Unassigned Components: tests Created: 20/Feb/2023 08:02 AM Fix Versions: 6.2-backlog Priority: Major Reporter: Yoann Rodière ( https://hibernate.atlassian.net/secure/ViewProfile.jspa?accountId=557058%... )
https://ci.hibernate.org/blue/organizations/jenkins/hibernate-search/deta... ( https://ci.hibernate.org/blue/organizations/jenkins/hibernate-search/deta... )
java.lang.AssertionError:
Expected size to be between: 1 and 999 but was: 0 in:
[]
at org.hibernate.search.integrationtest.mapper.orm.coordination.outboxpolling.automaticindexing.OutboxPollingAutomaticIndexingLifecycleIT.lambda$stopWhileOutboxEventsIsBeingProcessed$4(OutboxPollingAutomaticIndexingLifecycleIT.java:89)
at org.hibernate.search.util.impl.integrationtest.mapper.orm.PersistenceRunner.lambda$runInTransaction$2(PersistenceRunner.java:43)
at org.hibernate.search.util.impl.integrationtest.mapper.orm.PersistenceRunner.lambda$applyInTransaction$1(PersistenceRunner.java:36)
at org.hibernate.search.util.impl.integrationtest.mapper.orm.NativePersistenceRunner.lambda$applyInTransaction$0(NativePersistenceRunner.java:43)
at org.hibernate.search.util.impl.integrationtest.mapper.orm.OrmUtils.applyInTransaction(OrmUtils.java:49)
at org.hibernate.search.util.impl.integrationtest.mapper.orm.NativePersistenceRunner.lambda$applyInTransaction$1(NativePersistenceRunner.java:42)
at org.hibernate.search.util.impl.integrationtest.mapper.orm.NativePersistenceRunner.applyNoTransaction(NativePersistenceRunner.java:33)
at org.hibernate.search.util.impl.integrationtest.mapper.orm.NativePersistenceRunner.applyInTransaction(NativePersistenceRunner.java:40)
at org.hibernate.search.util.impl.integrationtest.mapper.orm.PersistenceRunner.applyInTransaction(PersistenceRunner.java:36)
at org.hibernate.search.util.impl.integrationtest.mapper.orm.PersistenceRunner.runInTransaction(PersistenceRunner.java:42)
at org.hibernate.search.integrationtest.mapper.orm.coordination.outboxpolling.automaticindexing.OutboxPollingAutomaticIndexingLifecycleIT.stopWhileOutboxEventsIsBeingProcessed(OutboxPollingAutomaticIndexingLifecycleIT.java:86)
at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:77)
at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.base/java.lang.reflect.Method.invoke(Method.java:568)
at org.junit.runners.model.FrameworkMethod$1.runReflectiveCall(FrameworkMethod.java:59)
at org.junit.internal.runners.model.ReflectiveCallable.run(ReflectiveCallable.java:12)
at org.junit.runners.model.FrameworkMethod.invokeExplosively(FrameworkMethod.java:56)
at org.junit.internal.runners.statements.InvokeMethod.evaluate(InvokeMethod.java:17)
at org.junit.internal.runners.statements.RunBefores.evaluate(RunBefores.java:26)
at org.hibernate.search.util.impl.integrationtest.common.rule.BackendMock$1.evaluate(BackendMock.java:58)
at org.hibernate.search.util.impl.integrationtest.common.rule.MappingSetupHelper$1.evaluate(MappingSetupHelper.java:75)
at org.hibernate.search.util.impl.integrationtest.common.TestConfigurationProvider$1.evaluate(TestConfigurationProvider.java:45)
at org.junit.runners.ParentRunner$3.evaluate(ParentRunner.java:306)
at org.junit.runners.BlockJUnit4ClassRunner$1.evaluate(BlockJUnit4ClassRunner.java:100)
at org.junit.runners.ParentRunner.runLeaf(ParentRunner.java:366)
at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:103)
at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:63)
at org.junit.runners.ParentRunner$4.run(ParentRunner.java:331)
at org.junit.runners.ParentRunner$1.schedule(ParentRunner.java:79)
at org.junit.runners.ParentRunner.runChildren(ParentRunner.java:329)
at org.junit.runners.ParentRunner.access$100(ParentRunner.java:66)
at org.junit.runners.ParentRunner$2.evaluate(ParentRunner.java:293)
at org.junit.runners.ParentRunner$3.evaluate(ParentRunner.java:306)
at org.junit.runners.ParentRunner.run(ParentRunner.java:413)
at org.junit.runners.Suite.runChild(Suite.java:128)
at org.junit.runners.Suite.runChild(Suite.java:27)
at org.junit.runners.ParentRunner$4.run(ParentRunner.java:331)
at org.junit.runners.ParentRunner$1.schedule(ParentRunner.java:79)
at org.junit.runners.ParentRunner.runChildren(ParentRunner.java:329)
at org.junit.runners.ParentRunner.access$100(ParentRunner.java:66)
at org.junit.runners.ParentRunner$2.evaluate(ParentRunner.java:293)
at org.junit.runners.ParentRunner$3.evaluate(ParentRunner.java:306)
at org.junit.runners.ParentRunner.run(ParentRunner.java:413)
at org.apache.maven.surefire.junitcore.JUnitCore.run(JUnitCore.java:55)
at org.apache.maven.surefire.junitcore.JUnitCoreWrapper.createRequestAndRun(JUnitCoreWrapper.java:137)
at org.apache.maven.surefire.junitcore.JUnitCoreWrapper.executeEager(JUnitCoreWrapper.java:107)
at org.apache.maven.surefire.junitcore.JUnitCoreWrapper.execute(JUnitCoreWrapper.java:83)
at org.apache.maven.surefire.junitcore.JUnitCoreWrapper.execute(JUnitCoreWrapper.java:75)
at org.apache.maven.surefire.junitcore.JUnitCoreProvider.invoke(JUnitCoreProvider.java:158)
at org.apache.maven.surefire.booter.ForkedBooter.runSuitesInProcess(ForkedBooter.java:456)
at org.apache.maven.surefire.booter.ForkedBooter.execute(ForkedBooter.java:169)
at org.apache.maven.surefire.booter.ForkedBooter.run(ForkedBooter.java:595)
at org.apache.maven.surefire.booter.ForkedBooter.main(ForkedBooter.java:581)
( https://hibernate.atlassian.net/browse/HSEARCH-4804#add-comment?atlOrigin... ) Add Comment ( https://hibernate.atlassian.net/browse/HSEARCH-4804#add-comment?atlOrigin... )
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#100216- sha1:3fa9804 )
1 year, 10 months
[JIRA] (HHH-16204) [EntityGraph] Does not fetch 4-level data
by Bartosz Herczyk (JIRA)
Bartosz Herczyk ( https://hibernate.atlassian.net/secure/ViewProfile.jspa?accountId=70121%3... ) *created* an issue
Hibernate ORM ( https://hibernate.atlassian.net/browse/HHH?atlOrigin=eyJpIjoiOTJkOGQ4YWIx... ) / Bug ( https://hibernate.atlassian.net/browse/HHH-16204?atlOrigin=eyJpIjoiOTJkOG... ) HHH-16204 ( https://hibernate.atlassian.net/browse/HHH-16204?atlOrigin=eyJpIjoiOTJkOG... ) [EntityGraph] Does not fetch 4-level data ( https://hibernate.atlassian.net/browse/HHH-16204?atlOrigin=eyJpIjoiOTJkOG... )
Issue Type: Bug Affects Versions: 6.1.6, 6.1.7 Assignee: Unassigned Created: 20/Feb/2023 06:49 AM Priority: Major Reporter: Bartosz Herczyk ( https://hibernate.atlassian.net/secure/ViewProfile.jspa?accountId=70121%3... )
I migrated hibernate *5.6.14.Final* to *6.1.7.Final* and I noticed a problem with entityGraph.
I have entities:
@Entity
public class Company {
@Id
@GeneratedValue(strategy = GenerationType.IDENTITY)
private Long id;
@ManyToOne(cascade = CascadeType.ALL, fetch = FetchType.LAZY)
private Factory factory;
}
@Entity
public class Factory {
@Id
@GeneratedValue(strategy = GenerationType.IDENTITY)
private Long id;
@ManyToOne(fetch = FetchType.LAZY, cascade = CascadeType.ALL)
private CarFactory carFactory;
}
public class CarFactory {
@Id
@GeneratedValue(strategy = GenerationType.IDENTITY)
private Long id;
@OneToMany(mappedBy = "carFactory" , cascade = CascadeType.ALL, orphanRemoval = true )
Set<Car> cars = new HashSet<>();
}
@Entity
public class Car {
@Id
@GeneratedValue(strategy = GenerationType.IDENTITY)
private Long id;
@OneToMany(mappedBy = "car" , cascade = CascadeType.ALL, fetch = FetchType.LAZY, orphanRemoval = true )
private Set<Feature> features = new HashSet<>();
@ManyToOne(cascade = CascadeType.ALL, fetch = FetchType.LAZY)
private CarFactory carFactory;
@ManyToOne(cascade = CascadeType.ALL, fetch = FetchType.LAZY)
private Info info;
}
@Entity
public class Feature {
@Id
@GeneratedValue(strategy = GenerationType.IDENTITY)
private Long id;
@ManyToOne(fetch = FetchType.LAZY)
private Car car;
@OneToOne(fetch = FetchType.LAZY)
private Factory factory;
}
@Entity
public class Info {
@Id
@GeneratedValue(strategy = GenerationType.IDENTITY)
private Long id;
}
When I want to fetch all these entities in one query using @EntityGraph :
@Query( "select c from Company c where c.id = :id" )
@EntityGraph(attributePaths = { "factory" , "factory.carFactory" , "factory.carFactory.cars" ,
"factory.carFactory.cars.features" , "factory.carFactory.cars.info"
})
Optional<Company> findByIdCustomEntityGraph( long id);
or using fetchGraph hint:
@Transactional(readOnly = true )
public Company getFetchGraphHint( long id) {
var companyGraph = entityManager.createEntityGraph(Company.class);
var factoryGraph = companyGraph.addSubgraph( "factory" );
var carFactoryGraph = factoryGraph.addSubgraph( "carFactory" );
var carsGraph = carFactoryGraph.addSubgraph( "cars" );
carsGraph.addAttributeNodes( "features" , "info" );
return entityManager.createQuery( "select c from Company c where c.id = :id" , Company.class)
.setParameter( "id" , id)
.setHint(SpecHints.HINT_SPEC_FETCH_GRAPH, companyGraph)
.getSingleResult();
}
The features and info data are not fetched.
Example project:
* hibernate 6.1.7 - tests failed https://github.com/bherczyk/hibernate_6_bugs/blob/master/src/test/java/co... ( https://github.com/bherczyk/hibernate_6_bugs/blob/master/src/test/java/co... )
* hibernate 5.6.14 - tests passed https://github.com/bherczyk/hibernate_6_bugs/blob/hibernate-5/src/test/ja... ( https://github.com/bherczyk/hibernate_6_bugs/blob/hibernate-5/src/test/ja... )
( https://hibernate.atlassian.net/browse/HHH-16204#add-comment?atlOrigin=ey... ) Add Comment ( https://hibernate.atlassian.net/browse/HHH-16204#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:d96fecc )
1 year, 10 months