CMP - Updating to DB

Discussions

EJB programming & troubleshooting: CMP - Updating to DB

  1. CMP - Updating to DB (1 messages)

    Hi,
      When does the CMP issue UPDATE statement to DB? Suppose I have 10 fields in a table and I am modifing a record. I will issue the set methods for each column. Will the CMP issue UPDATE statement for each set method or 1 single UPDATE statement to update all the fields?
     If it is separate UPDATE statements for each set method, is there any way that I tell the CMP to update all the fields in one single UPDATE statement? Please let me know.

    Thanks in advance,
    Prasanna Kumar

    Threaded Messages (1)

  2. CMP - Updating to DB[ Go to top ]

    In Ejb 1.1 "is-modified-method-name" was used to check the fields have been modified and the container used to make one ejbStore() to save changed data. But isModified() is no longer required for 2.0 CMP entity EJBs based on the EJB 2.0 specification. However, it still applies to BMP and 1.1 CMP EJBs.
    When you deploy EJB 2.0 entity beans with cmp, app Server automatically detects the fields that were modified, and write/update only those fields.

    This is very much correct with weblogic server and I hope all other servers would be doing the same.