-
1. Re: ejbStore() question
jfifield Sep 25, 2001 12:35 PM (in response to andrejx)JBoss uses a method called isModified to determine if the entity needs to be saved. The default implementation of this simply returns true. Override this method in the bean and only return true when something has been modified. I set it local modified flag to true in all setXXX methods, then set it to false in ejbStore and ejbLoad, and use that as the return value of isModified. You may also have to reset it in ejbActivate, I don't remember...
Joe -
2. Re: ejbStore() question
andrejx Sep 25, 2001 12:52 PM (in response to andrejx)Thanks a lot! Is this a common practice for App Servers? What about WebLogic and WebSphere? Do they have something like this isModified() function?
AX -
3. Re: ejbStore() question
p_d_austin Sep 25, 2001 3:23 PM (in response to andrejx)WebLogic does, there is a tag in the weblogic-ejb-jar to tell it which method to use.
Another thing you should look at doing is define you session been method to have the transaction attribute REQUIRED and the transaction attributes on your entity bean methods to SUPPORTS (which I think is the default). This will then roll back all the changes in the case of errors and also cause ejbStore to only be called at the end of the transaction.