Bug 1009615 - EJB2 CMP Entities are not synchronized to the DB under special circumstances (business logic inside the EntityBean)
Summary: EJB2 CMP Entities are not synchronized to the DB under special circumstances ...
Keywords:
Status: CLOSED CURRENTRELEASE
Alias: None
Product: JBoss Enterprise Application Platform 6
Classification: JBoss
Component: EJB
Version: 6.0.1,6.1.0,6.1.1
Hardware: Unspecified
OS: Unspecified
unspecified
unspecified
Target Milestone: ER3
: EAP 6.2.0
Assignee: wfink
QA Contact: Jan Martiska
URL:
Whiteboard:
Depends On:
Blocks: 1010886 1012664
TreeView+ depends on / blocked
 
Reported: 2013-09-18 17:29 UTC by wfink
Modified: 2018-12-03 19:59 UTC (History)
1 user (show)

Fixed In Version:
Clone Of:
: 1010886 (view as bug list)
Environment:
Last Closed: 2013-12-15 16:55:15 UTC
Type: Bug
Embargoed:


Attachments (Terms of Use)

Description wfink 2013-09-18 17:29:34 UTC
If a entity method is called via the component interface and inside this method actions are called which force a database synchronization, i.e. ejbSelect... or finder, a following change to this entity might not persist to the database if a ejbSelect or finder is called.

This will be temporary an inconsistent state.



Example:

EntityA {
  abstract void setAttrib1(int attrib);
  abstract void setAttrib2(int attrib);
  abstract void ejbSelect1(...);

  public void update(...) {
    setAttrib1(...);
    ejbSelect1(...);  // the attrib1 will be flushed to the DB
    setAttrib2(...);  // this attrib might not flushed until there is no other CMP entity method invoked
  }


As workaround the setter can be called via the LocalObject, i.e.
   ((EntityALocal)myEntityContext.getEJBLocalObject()).setAttrib2(...)

Comment 4 Jan Martiska 2013-10-07 08:17:49 UTC
Verified in EAP 6.2.0.ER4.


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