Title: RE: Dynamic finder method with CMP

Wade et al:

We had this same scenario and we chose to use a session bean for the dynamic querying.  We found that performance would be heavily impacted by using a CMP entity bean (since you'd have one database hit for the initial find, and then 1 hit for each entity bean that is created).  At that point, it came down between a BMP entity bean and a session bean.  There wasn't any advantage to creating an entity bean that represented query results, and if anything, it would consume more resources than the session bean approach.  A stateless session bean could be used to perform the query and return a business object representing the results, and then thrown away.

In general, our pattern is this:

When the user is performing an action that will return multiple entities (rows) from the database (and it is typically a small number of attributes for those entities), we use a stateless session bean.

When the user is performing an action that will return detailed information about a single entity (row) from the database, we use entity beans.

-tb

    -----Original Message-----
    From:   Wade Catlyn [SMTP:[EMAIL PROTECTED]]
    Sent:   Thursday, June 08, 2000 6:58 PM
    To:     [EMAIL PROTECTED]
    Subject:        Dynamic finder method with CMP

    Hi folks,

    I wish to implement an entity bean that has a findBy method whose search
    criteria is specified dynamically. This would be useful for operations
    where a user can specify what criteria he wishes to search by. (e.g an
    html form with several fields such as name, age, address, date... etc,
    and the query would be composed using only the fields which the user
    selects).

    This can be easily done using bean managed persistence by having a
    method of the form: findByCriteria(SearchCriteria sc)
    where the desired query would be composed using the information
    extracted from the SearchCriteria object.

    However this would not be possible if container managed persistence is
    used.

    Does anyone have any suggestions on how this kind on functionality could
    be implemented without having to give up the advanteges of CMP ?

    thanks

    Wade Catlyn

    ===========================================================================
    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".



***************************************************************************************
WARNING: All e-mail sent to and from this address will be received or
otherwise recorded by the A.G. Edwards corporate e-mail system and is
subject to archival, monitoring or review by, and/or disclosure to,
someone other than the recipient.
***************************************************************************************

Reply via email to