Hello!

Should I write the code like this:

private transient boolean loaded = false;
public void ejbLoad(){
  if(loaded)
    return;
  loaded = true;
  // load data
}

Will this code work correct if the container passivate/activate my bean?


It seems that container works like this:
<remote method call>;
ejbStore();
ejbLoad();

Could  you  explain  why  it  is  necessary  for the container to call
ejbLoad() after each ejbStore()?

With best regards,
 Stanislav Markin                       mailto:[EMAIL PROTECTED]


HJ> Hi,

HJ> This feature is only for entity bean with container-managed persistence.
HJ> Indeed, entity bean with bean-managed persistence can itself
HJ> implement this kind of optimization. In BMP case, the data access
HJ> in the database are completely done and controled by the bean.

HJ> Kind regards.
HJ> H�l�ne.

HJ> Stanislav Markin wrote:
>> 
>> Hello!
>> 
>>   I've  got  problem using isModified extension. I have BMP bean which
>>   is "read-only".
>> 
>>   As described in JOnAS docs, I declared isModified method:
>> 
>>   public boolean isModified(){
>>     Log.log("enter", "ClassifMetadataEJB.isModified()");
>>     return false;
>>   }
>> 
>>   and modified jonas xml descriptor:
>> 
>> <!DOCTYPE jonas-ejb-jar SYSTEM "jonas-ejb-jar.dtd">
>> <jonas-ejb-jar>
>>   <jonas-entity>
>>     <ejb-name>ClassifMetadata</ejb-name>
>>     <is-modified-method-name>isModified</is-modified-method-name>
>>     <jndi-name>com.ulterwest.server.core.ClassifMetadataHome</jndi-name>
>>   </jonas-entity>
>> </jonas-ejb-jar>
>> 
>>   And  method  isModified  is  never called. Instead after each remote
>>   call ejbStore and ejbLoad are called. I want to prevent ejbLoad call
>>   after each remote call.
>> 
>>   Maybe  I  need  to  place isModified method in remote interface (not
>>   only in Impl class)?
>> 


----
To unsubscribe, send email to [EMAIL PROTECTED] and
include in the body of the message "unsubscribe jonas-users".
For general help, send email to [EMAIL PROTECTED] and
include in the body of the message "help".

Reply via email to