did anyone can tell me this problem's key?please!

Discussions

EJB programming & troubleshooting: did anyone can tell me this problem's key?please!

  1. did anyone can tell me this problem's key?please! (5 messages)

    Which of the following requirements for the ejbCreate() method in a stateless session bean are correct?
    A) It must have only one ejbCreate() method
    B) The ejbCreate() method must return the void return type
    C) The ejbCreate() method must contain no arguments
    D) If the ejbCreate() method is run successfully, an object of the type EJBHome is created
  2. From the EJB 2.0 final spec section 7.10.3

    >> A) It must have only one ejbCreate() method

    "The session bean class must define one *or more* ejbCreate<Method> methods" So no this is not correct.


    >> B) The ejbCreate() method must return the void return type

    "The return type must be void" So yes this is correct.

    >> C) The ejbCreate() method must contain no arguments

    " The method arguments must be legal types for RMI/IIOP if there is a create<METHOD>(...) corresponding to the ejbCreate<METHOD>(...) method on the session bean’s remote home interface." So no this is not correct.

    >> D) If the ejbCreate() method is run successfully, an object of the type EJBHome is created


    See the state diagram in Figure 6 section 7.7.2. A local home is created. So yes this is correct.

    I suggest your own copy of the spec. Its a free download from java.sun.com

    Dave Wolf


  3. thanks.
    but in here,it is a stateless session bean.Did u sure that a stateless session bean has more ejbCreate() and with parameter.it is not significative because a stateless session bean can't remain the state.
  4. in addition,i think D is wrong,the correct word is "an object of the type EJBObject is created",not EJBHome.
    Do u think so?
  5. answers are a,b,c(since it is a stateless session bean..)
    N'Joy.......
  6. Good luck in your exam...