Mantis - Resin
Viewing Issue Advanced Details
291 minor always 06-30-05 00:00 11-30-05 14:43
user241  
 
urgent  
closed 3.0.13  
3.0.13 fixed  
none    
none 3.0.15  
0000291: business methods in ejb 2.x beans in amber always cause reload from database
RSN-330
in resin 3.x, if a wrapper business method is called on a cmp bean, it always causes the bean to reload, regardless of it's cache/read-only state. if only the individual persistent field getters are called then it observes cache/read-only behavior. this worked fine in resin 2.x.

eg. in the below (and attached) cmp bean, if the getDetails method of the bean is called, then it reloads the bean from the db, but if the individual getters are called, it doesn't

WMDataEntitlement myBean = ... // load from cache
EntitlementDetails details = new EntitlementDetails(myBean.getEntitlement(), myBean.getDatatype()); // the getters obey cache/read-only state
EntitlementDetails details = myBean.getDetails(); // this *always* causes bean to reload from db query


public interface WMDataEntitlement extends EJBLocalObject {
    
  Webmaster getWebmaster();
  EntitlementDetails getDetails();
  String getEntitlement();
  String getDatatype();
}

abstract public class WMDataEntitlementBean extends com.caucho.ejb.AbstractEntityBean {
    
    abstract public Webmaster getWebmaster();
    abstract public String getDatatype();
    abstract public String getEntitlement();

    ...

    public EntitlementDetails getDetails() throws EJBException {
        return new EntitlementDetails(getDatatype(), getEntitlement());
    }
}

cheers
christian
resin pro 3.0, cmp 2.x, beans

Notes
(0000326)
user241   
06-30-05 00:00   
attached are the 3 parts of the bean implementation, local/home/bean
(0000327)
ferg   
06-30-05 00:00   
ejb/0897