Caching of EJBHome

Discussions

EJB design: Caching of EJBHome

  1. Caching of EJBHome (1 messages)

    Hi all,
    Here is our scenario.
    We have a SLSB1 and SLSB2. In create method of SLSB1 we are getting a remote reference of SLSB2 and storing it in a private variable of SLSB1.This remote reference of SLSB2 is used in the business method of SLSB1.
    We are calling SLSB2.remove() in ejbRemove() of SLSB1.
    I heard that it is not a good practice to do this,instead cache the home or remote handle and get the reference again in business method because remote object may be stale by someone.
    I want to know about the stealing of remote object as told to me???Can anybody please explain me what is meant by stale a remote object? We are using WLP 7.0 SP4.
    Thanks in advance
    Amit

    Threaded Messages (1)

  2. Caching of EJBHome[ Go to top ]

    Hi all,

    > Here is our scenario.
    > We have a SLSB1 and SLSB2. In create method of SLSB1 we are getting a remote reference of SLSB2 and storing it in a private variable of SLSB1.This remote reference of SLSB2 is used in the business method of SLSB1.
    > We are calling SLSB2.remove() in ejbRemove() of SLSB1.
    > I heard that it is not a good practice to do this,instead cache the home or remote handle and get the reference again in business method because remote object may be stale by someone.
    > I want to know about the stealing of remote object as told to me???Can anybody please explain me what is meant by stale a remote object? We are using WLP 7.0 SP4.
    > Thanks in advance
    > Amit

    Hi,

    I think u must refer to Service Locator Design Pattern. It tells about how to avoid doing JNDI look up of home objects of the same type. The Service Locator can cache the initial context objects and references to the factory objects. This will reduce lot of network traffic.
    Please correct me if I am wrong.
    I am not sure of staling remote object.

    Thanks,
    Prasanna