Discussions

EJB design: Aggregate Pattern- What is the Best Design Practice

  1. Aggregate Pattern- What is the Best Design Practice (5 messages)

    I have some Entity beans which are aggregate like Order and it's detais line items are modelled as one single entity bean.

    The problem is the ejbStore method issues a lot of SQL's to the database. I should issue SQL's for changed fields only.

    I'm using BMP and Weblogic 5.1 server.
    I optimize a little by using the isModified method but still for change in only one line item it issues Update SQL for all the 1000(for example) line items.

    Save me or give me some hints or references.
  2. Why not have a separate vector in your order for line items that get changed? Once ejbStore is called, only save those line items to the database, then clear the "changed items" vector.

    Floyd
  3. How about use CachedRowset to aggreate your lineitems. It will propage back only the changes (include insert, edit and delete) you make.

    Mickey Hsieh
    CAM Commerce Solutions
  4. Hi!

    What´s CachedRowset?

    Thanks
  5. CachedRowSet is a disconnected, serializable, scroabble container for tabular data.

    It is for sending data to the thin clients. Sun will be providing three classes CachedRowSet, JDBCRowSet and WebRowSet for disconnected tabular data. These classes implements RowSet interface.

    I it is available through JDC at java.sun.com, and will be released soon.

    Hope it helps,
    Vijay Shrivastava
  6. Why not model this as two Entity Beans? Just store a reference to the home of the Order lines inside Order.