Bug 1389846

Summary: [GSS] (6.4.z) Queries sent to database for entities/associations that should be resolved in level 2 cache
Product: [JBoss] JBoss Enterprise Application Platform 6 Reporter: Stephen Fikes <sfikes>
Component: Infinispan, HibernateAssignee: Gail Badner <gbadner>
Status: CLOSED WONTFIX QA Contact:
Severity: high Docs Contact:
Priority: high    
Version: 6.3.3CC: gbadner, sfikes, sjacobs, ttarrant
Target Milestone: ---   
Target Release: ---   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2016-11-17 21:28:55 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Attachments:
Description Flags
testcase none

Description Stephen Fikes 2016-10-28 21:54:58 UTC
Created attachment 1215109 [details]
testcase

Description of problem:
I've a "graph" of entities that I'm loading (4 entity types with associations between them) starting with a simple (cacheable) query at the root of the graph then "navigation" of the associations from the graph "root". I repeat the exact logic 4 times (four separate transactions) and encounter unexpected queries the second and third times.

Version-Release number of selected component (if applicable):


How reproducible:
Consistently

Steps to Reproduce:
See attached testcase

Actual results:
The 1st time I load the graph, I see queries to load the graph from the database. The 2nd time I see a *different* set of queries to the database. The 3rd time, I see a single query (different from the 1st and 2nd times). Finally, on the 4th try (and on each subsequent try of the same logic) I see *no* queries.


Expected results:
There should be database queries *only* on the 1st "loop" when loading the graph. Every subsequent loop should resolve all entities and associations in the level 2 cache.

Additional info:
The fact that 4th (and all subsequent attempts) work without any database queries suggests that the 2nd and 3rd loops exhibit a defect.

Comment 1 Stephen Fikes 2016-10-28 21:58:58 UTC
Note that the issue is *not* reproducible with EAP 7.0.z

Note also, I am not certain if the issue is within Infinispan or Hibernate or if it spans the two components. I do not have a pure Infinispan test for the issue. The test requires Hibernate + Infinispan + EAP.

Comment 4 Gail Badner 2016-11-17 21:28:55 UTC
This actually does appear to be a bug. As Radim says, fixing it may cause other problems.

Closing as WONTFIX.