Bug 991444

Summary: EJB2 CMP wrong cache access if optimistic-locking=true
Product: [JBoss] JBoss Enterprise Application Platform 6 Reporter: wfink
Component: EJBAssignee: wfink
Status: CLOSED CURRENTRELEASE QA Contact: Jan Martiska <jmartisk>
Severity: unspecified Docs Contact:
Priority: unspecified    
Version: 6.1.0CC: istudens, smumford, wfink
Target Milestone: ER1Flags: wfink: needinfo+
Target Release: EAP 6.2.0   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
When optimistic locking was configured for EJB2 Entity Beans, cached entity beans were never being found in the cache. This occurred because the cache lookup was being performed using the wrong identifier. The entity primary key was being used to locate the correct transaction cache instead of the transaction identifier. This has been corrected and cache access for EJB2 Entity Beans now works as expected when optimistic locking is enabled.
Story Points: ---
Clone Of: Environment:
Last Closed: 2013-12-15 16:22:34 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 wfink 2013-08-02 12:10:55 UTC
If entities are read from the cache, and if the ejb3 entity-bean is configured for optimistic-locking, the implementation of TransactionLocalEntityCache is used.

The methods to find entities access an internal Map where the key is the Tx-Id.
But the check is done by use the entity-PKey instead of the Tx-Id.
The PKey must be used later if the transactional cache is selected.

Comment 2 wfink 2013-08-05 07:32:49 UTC
PR send:
https://github.com/jbossas/jboss-eap/pull/275

Comment 3 Ivo Studensky 2013-10-04 10:12:07 UTC
It has been already merged, thus moving this to ON_QA.

Comment 4 Jan Martiska 2013-10-07 10:42:22 UTC
Verified in EAP 6.2.0.ER4.

Comment 5 Scott Mumford 2013-11-26 00:07:35 UTC
Hi Wolf

Can you please provide more information about this bug, for release notes purposes?

I can see your description of the situation, but I'm not able to ascertain if this was a bug (that presented unexpected and unwanted behavior in the product) or if it is a request to optimize the product in some way.

The Doc Text field above is a pre-formatted template that outlines the requirements for a complete release note. 

If you could provide the required information, it would be greatly appreciated.