Mantis - Resin
Viewing Issue Advanced Details
1265 minor always 07-24-06 09:09 09-08-06 10:23
ferg  
 
normal  
closed  
fixed  
none    
none 3.1.0  
0001265: EJB/Amber create/getter/setter issues
(rep by Gary Zhu)


http://bugs.caucho.com/view.php?id=971 [^]
EJB setter methods still do not work until after a getter is called.

Hmm. The test case for that situation is passing, so I'm not sure
what the difference it.


We are creating EJB and then setting some fields in
the same transaction, I suspect that might be the cause.

I stepped through the following code, when
1. EJB was created and
2. non of the getter methods is called and
3. code was still in the same session bean

then
 __caucho_dirtyMask_1 was not 0
 __caucho_session.update(this) was not invoked
 and setter value was not saved.

As soon as a getter method was called, __caucho_dirtyMask_1 becomes 0.

========= code =============

EquipmentCMP_Amber.class:

  public void setSellerIdField(int v)
  {
    int oldValue = __caucho_super_get_sellerIdField();
    if (oldValue == v && (__caucho_loadMask_0 & 1L) != 0)
      return;
    __caucho_super_set_sellerIdField(v);

    long oldMask = __caucho_dirtyMask_1;
    __caucho_dirtyMask_1 |= 33554432L;

    if (__caucho_session != null && oldMask == 0)
      __caucho_session.update(this);
  }

=========end of code ==============

Our (code change) workaround has been to invoke getter method right after EJB creation.




Notes
(0001502)
westrupp   
09-08-06 10:23   
Test case jpa/0ga1. (Rodrigo Westrupp)