Re: CMP and writing instance back to database
Victor Langelo <[email protected]> Mon, 19 Apr 2004 09:40:18 -0400
| Newsgroups | gmane.comp.java.sun.ejb.general |
|---|---|
| Message-ID | <[email protected]> |
Janne, I don't see any contradictions here. Synchronize instance state with the persistent storage doesn't mean writting every field back to the database. The text you quote from Table 6 is just a label. I wouldn't read much into these few words. So the anwser is c) The container is responsible for making sure the bean is in sync with the persistent store as modified by the various commit options. Synchronize would imply that not all fields are written to the database and under commit option C all fields should probably be checked for concurrent modifications. --Victor Janne Mattila wrote: >Some confusion about the EJB specification: > >EJB 2.1 specification, 10.5.10, "commit options" states that "container >synchronizes the instance's state with the persistent storage at >transaction commit for all three (commit) options". Table 6 states this >even more explicitly, having "Yes" at "Write instance state to database" >for all commit options. Reading this, I would assume that the specification >requires CMP engine to write each bean back to database at commit time, no >matter what. > >This in contradiction with my experiences with WebLogic. WebLogic 6.1 >"...Server CMP implementation automatically detects modifications of CMP >fields and writes only those changes to the underlying datastore.". This >seems logical, as writing CMP fields back when they have not been changed >would not be efficient. > >Does anyone have an idea on what is really going on here: > >a) the intent of specification indeed requires that all fields be written >back to db at commit, but WebLogic has chosen not to follow the >specification to ensure better performance >b) specification is written a bit badly, and in fact it requires that >ejbStore() be called at commit time - and WebLogic follows that >specification properly >c) something else? > >=========================================================================== >To unsubscribe, send email to [email protected] and include in the body >of the message "signoff EJB-INTEREST". For general help, send email to >[email protected] and include in the body of the message "help". > > =========================================================================== To unsubscribe, send email to [email protected] and include in the body of the message "signoff EJB-INTEREST". For general help, send email to [email protected] and include in the body of the message "help".