2 Replies Latest reply on Jul 12, 2006 12:21 AM by beep_beep

    EJB3 and Home Interface Support

    beep_beep

      Hi,
      My simple question is:
      Is there some replacement to old Home interface(except backward support of ejb2.1) in session beans?
      What mechanism should I use to create several instances of the same session bean Type?

      How to find instances?
      link to some examples, please, if you could.
      Thanks a lot!

        • 1. Re: EJB3 and Home Interface Support
          bdecoste

          If you specify a home interface using either the @RemoteHome/@LocalHome annotations or with the or <local-home> elements in ejb-jar.xml, EJB3s will behave as 2.x EJBs. Everytime you lookup an instance in the JNDI context, you will acquire a new instance of an EJB - the jndi lookup behavior is identical to a create on a home interface. When you do the lookup, you receive a proxy to the EJB, but the proxy does not have an instance on the server side until the bean is invoked for the first time.

          Take a look at the tutorials that are bundled with EJB3 for examples.

          • 2. Re: EJB3 and Home Interface Support
            beep_beep

            Thanks for answer.

            My question exactly is : how can I operate without old EJB2 stuff, but create new instances of bean with some ID and then find instance by ID. Does ejb3 has some replacement on ejbCreate(id), ejbFind(id)?

            I looked in examples, but there is only co-working with ejb2 example, but there is not example of ejb3, working with bean instance, which does have id.
            Could you , please, give me little more information.
            Thanks!!