Bug 900321 (JBPAPP6-1487) - HHH-7287 Problem in caching proper natural-id-values when obtaining result by naturalIdQuery using NaturalIdLoadAccess
Summary: HHH-7287 Problem in caching proper natural-id-values when obtaining result by...
Keywords:
Status: CLOSED WONTFIX
Alias: JBPAPP6-1487
Product: JBoss Enterprise Application Platform 6
Classification: JBoss
Component: Hibernate
Version: 6.0.0
Hardware: Unspecified
OS: Unspecified
high
medium
Target Milestone: ---
: TBD EAP 6
Assignee: Gail Badner
QA Contact: Martin Simka
URL: http://jira.jboss.org/jira/browse/JBP...
Whiteboard: eap601candidate
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2012-04-30 14:07 UTC by Madhumita Sadhukhan
Modified: 2015-09-22 23:11 UTC (History)
8 users (show)

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.
Clone Of:
Environment:
Last Closed: 2015-09-22 23:11:24 UTC
Type: Bug


Attachments (Terms of Use)


Links
System ID Priority Status Summary Last Updated
JBoss Issue Tracker JBPAPP6-1487 Major Closed HHH-7287 Problem in caching proper natural-id-values when obtaining result by naturalIdQuery using NaturalIdLoadAccess 2015-09-24 22:36:57 UTC

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.


Note You need to log in before you can comment on or make changes to this bug.