Bug 991444 - EJB2 CMP wrong cache access if optimistic-locking=true
Summary: EJB2 CMP wrong cache access if optimistic-locking=true
Keywords:
Status: CLOSED CURRENTRELEASE
Alias: None
Product: JBoss Enterprise Application Platform 6
Classification: JBoss
Component: EJB
Version: 6.1.0
Hardware: Unspecified
OS: Unspecified
unspecified
unspecified
Target Milestone: ER1
: EAP 6.2.0
Assignee: wfink
QA Contact: Jan Martiska
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2013-08-02 12:10 UTC by wfink
Modified: 2018-12-02 15:50 UTC (History)
3 users (show)

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.
Clone Of:
Environment:
Last Closed: 2013-12-15 16:22:34 UTC
Type: Bug
Embargoed:
wfink: needinfo+


Attachments (Terms of Use)

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.


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