Bug 900321 (JBPAPP6-1487)

Summary: HHH-7287 Problem in caching proper natural-id-values when obtaining result by naturalIdQuery using NaturalIdLoadAccess
Product: [JBoss] JBoss Enterprise Application Platform 6 Reporter: Madhumita Sadhukhan <msadhukh>
Component: HibernateAssignee: Gail Badner <gbadner>
Status: CLOSED WONTFIX QA Contact: Martin Simka <msimka>
Severity: medium Docs Contact:
Priority: high    
Version: 6.0.0CC: atangrin, lcosti, msimka, pslavice, rdickens, stliu, theute, zroubali
Target Milestone: ---   
Target Release: TBD EAP 6   
Hardware: Unspecified   
OS: Unspecified   
URL: http://jira.jboss.org/jira/browse/JBPAPP6-1487
Whiteboard: eap601candidate
Fixed In Version: Doc Type: Known Issue
Doc Text:
The Hibernate interface `NaturalIdLoadAccess` behaves inconsistently when trying to load entities from the Level Two (L2) Cache following an update of their `natural-id` values from a non-transactional scenario. Hibernate currently does not support proper L2 caching of entities with natural identifiers in scenarios where there is a mix of transactional and non-transactional access to the database.
Story Points: ---
Clone Of: Environment:
Last Closed: 2015-09-22 23:11:24 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:
Embargoed:

Description Madhumita Sadhukhan 2012-04-30 14:07:44 UTC
Affects: Release Notes
project_key: JBPAPP6

This could be a valid bug and should be fixed:

https://hibernate.onjira.com/browse/HHH-7287


Copying conversation from my mail with the problem escalated on hibernate-dev-list

The entitymapping information for Person is in file HibernateNativeAPINaturalId2LCachingTestCase.java in string testmapping.
For convenience I have uploaded the test to my AS7 github as follows:

https://github.com/madhumita12/jboss-as/blob/master/testsuite/integration/basic/src/test/java/org/jboss/as/test/integration/hibernate/naturalid/HibernateNativeAPINaturalId2LCachingTestCase.java

Files you need to look at:

HibernateNativeAPINaturalId2LCachingTestCase.java
SFSB2LcacheNaturalId.java
Person.java

This testcase will fail in this branch as it uses hibernate 4.1.2 and in order to run it successfully you could just replace with 4.1.3 hibernate jars after building this branch.

I have tried to put adequate comments to express my location of confusion.

Guenther,

I agree with your reasoning for steps 5 and step 7 as I am using Container Managed Transaction where isolation level (if it is not defined) picks up the default for the underlying Database which is inbuilt H2 for AS7 in this case and default isolation used for H2 is read-committed.

However as I have already explained in my previous mail I am rather confused/concerned with the discrepancy in behaviour between step 5 and step 6 as step 6 returns me null when I use the same NaturalIdLoadAccess object to load the entity using previous values which looks inconsistent!

Comment 1 Rajesh Rajasekaran 2012-04-30 16:39:08 UTC
Labels: Added: eap6_need_triage


Comment 4 Strong Liu 2012-05-09 02:38:38 UTC
Affects: Added: Release Notes


Comment 5 Madhumita Sadhukhan 2012-05-10 10:28:54 UTC
Release Notes Text: Added: NaturalIdLoadAccess behaves inconsistently when trying to load entities from 2Lcache after an update of natural-id values from a non-transactional scenario.
Hibernate does not support proper 2L caching of entity and natural ids in scenarios where there is a mix of  transcational and non-transactional acess to the database.



Comment 6 Madhumita Sadhukhan 2012-05-10 10:32:16 UTC
Release Notes Text: Removed: NaturalIdLoadAccess behaves inconsistently when trying to load entities from 2Lcache after an update of natural-id values from a non-transactional scenario.
Hibernate does not support proper 2L caching of entity and natural ids in scenarios where there is a mix of  transcational and non-transactional acess to the database.
 Added: NaturalIdLoadAccess behaves inconsistently when trying to load entities from 2Lcache after an update of natural-id values from a non-transactional scenario.
Hibernate currently does not support proper 2L caching of entity and natural ids in scenarios where there is a mix of  transactional and non-transactional access to the database.



Comment 7 Madhumita Sadhukhan 2012-05-10 10:33:28 UTC
Release Notes Text: Removed: NaturalIdLoadAccess behaves inconsistently when trying to load entities from 2Lcache after an update of natural-id values from a non-transactional scenario.
Hibernate currently does not support proper 2L caching of entity and natural ids in scenarios where there is a mix of  transactional and non-transactional access to the database.
 Added: NaturalIdLoadAccess behaves inconsistently when trying to load entities from 2Lcache after an update of their natural-id values from a non-transactional scenario.
Hibernate currently does not support proper 2L caching of entities with natural ids in scenarios where there is a mix of  transactional and non-transactional access to the database.



Comment 8 Rajesh Rajasekaran 2012-07-11 19:56:31 UTC
Labels: Removed: eap6_need_triage Added: eap601candidate


Comment 9 Dana Mison 2012-10-16 00:19:01 UTC
Release Notes Text: Removed: NaturalIdLoadAccess behaves inconsistently when trying to load entities from 2Lcache after an update of their natural-id values from a non-transactional scenario.
Hibernate currently does not support proper 2L caching of entities with natural ids in scenarios where there is a mix of  transactional and non-transactional access to the database.
 Added: NaturalIdLoadAccess behaves inconsistently when trying to load entities from the 2L Cache after an update of their natural-id values from a non-transactional scenario.

Hibernate currently does not support proper 2L caching of entities with natural ids in scenarios where there is a mix of  transactional and non-transactional access to the database.



Comment 10 Dana Mison 2012-10-16 00:27:55 UTC
Release Notes Text: Removed: NaturalIdLoadAccess behaves inconsistently when trying to load entities from the 2L Cache after an update of their natural-id values from a non-transactional scenario.

Hibernate currently does not support proper 2L caching of entities with natural ids in scenarios where there is a mix of  transactional and non-transactional access to the database.
 Added: NaturalIdLoadAccess behaves inconsistently when trying to load entities from the Level Two(L2) Cache after an update of their natural-id values from a non-transactional scenario.

Hibernate currently does not support proper L2 caching of entities with natural IDs in scenarios where there is a mix of  transactional and non-transactional access to the database.


Comment 11 Dana Mison 2012-10-16 00:28:12 UTC
Release Notes Docs Status: Added: Documented as Known Issue
Writer: Added: Darrin


Comment 12 Brett Meyer 2012-11-01 18:59:01 UTC
Discussion still ongoing in HHH-7287.

Comment 13 Anne-Louise Tangring 2012-11-13 21:00:28 UTC
Release Notes Docs Status: Removed: Documented as Known Issue 
Writer: Removed: Darrin 
Release Notes Text: Removed: NaturalIdLoadAccess behaves inconsistently when trying to load entities from the Level Two(L2) Cache after an update of their natural-id values from a non-transactional scenario.

Hibernate currently does not support proper L2 caching of entities with natural IDs in scenarios where there is a mix of  transactional and non-transactional access to the database. 
Docs QE Status: Removed: NEW 


Comment 16 Russell Dickenson 2013-07-25 01:40:47 UTC
I reset the Release Notes Flag to "?" as the text needs further work before publication.