Title: RE: Session Bean's for Querying???

the problem with entity beans is that one read would imply 3 db hits, unless the server provides optimisation facilities (weblogic 5.1). One hit when the finder method is invoked, a remote reference object is returned, then the container synchorises the data from the dbase before a method invocation so another hit, & another when the bean is passivated & ejbStore is called.. this works well for transactions but for read only operations it this is a killer.. Yes there are advantages of the bean being in the memory but i think the db hits kills it.. moreover if the bean that is required in the memory then it might save one db operation & yes time is also saved as the pool of entity beans is already there.. but still this will be resource heavy for read oly operations..

This is my understanding.. PLease correct me if i am wrong..



    -----Original Message-----
    From:   Sharat Hegde [SMTP:[EMAIL PROTECTED]]
    Sent:   Monday, May 29, 2000 8:37 PM
    To:     [EMAIL PROTECTED]
    Subject:        Session Bean's for Querying???

    Most of the EJB books encourage us to use Stateless session beans for
    reusable queries.
    I however have a doubt regarding this.

    If I encapsulate my query say in getMemberInfo(String Id) which happens to
    be one of my business methods of a stateless session bean, then I understand
    that every time a client comes to my site and wants to view his info then my
    session bean is going to make a DB hit.  Assuming that my site receives
    100000 hits per second or say atleast 100 hits per second then each time my
    session bean will have to hit the DB. And hitting the DB and returning the
    resultset involves time and also chews up resources. Isn't it?
    So knowing all this do I still have to go for session beans? I also assume
    that i am using connection pool for picking up DB connections.

    If I use my entity bean with a findbyMemberId(String Id) then probably I
    would reduce this overhead, because the entity's memory will be loaded with
    that particular record. So next time the same user comes then I will not
    have to hit the DB ( of course I am assuming that the entity bean is still
    present in the server.)

    Please give me more insights from ur experience and understanding..

    Thanks

    > Love
    > Gp
    > Extn:3471

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

�������������������������o 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".

Reply via email to