This content has been marked as final.
Show 4 replies
-
1. Re: ejbCreate with parameters for Stateless Session Bean
darranl Oct 7, 2004 4:59 AM (in response to enterprisejavabones)am i doing something wrong.
Yes - Stateless session beans are not allowed to take parameters for ejbCreate - the bean instance created is NOT associated with a specific client.According to the EJB 2.1 Spec (Sec 7.11.3, p110), we should be able to define ejbCreate methods in Session Beans that take parameters. Is it just that 3.0.8 is based on an older version of the EJB spec that didn't allow ejbCreate methods to take arguments?
Yes STATEFUL session beans can take parameters. The spec will tell you that stateless beans can not take parameters. -
2. Re: ejbCreate with parameters for Stateless Session Bean
djeang Mar 10, 2005 1:01 PM (in response to enterprisejavabones)Where ?
I have read the whole spec and I found nowhere that stateless cannot support ejbCreate with parameter ?
Perhaps i've missed something. Can somebody tell me where exactly on the specs it is specified ?
Thanks you. -
3. Re: ejbCreate with parameters for Stateless Session Bean
starksm64 Mar 10, 2005 1:10 PM (in response to enterprisejavabones)Its rather hard to miss:
ejb 2.1 spec, 7.11.3 ejbCreate<METHOD> Methods
The session bean class must define one or more ejbCreate<METHOD> methods whose signatures must follow these rules:
+ The method name must have ejbCreate as its prefix.
+ The method must be declared as public.
+ The method must not be declared as final or static.
+ The return type must be void.
+ 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.
+ A stateless session bean must define a single ejbCreate method, with no arguments.
+ The throws clause may define arbitrary application exceptions, possibly including the javax.ejb.CreateException. -
4. Re: ejbCreate with parameters for Stateless Session Bean
darranl Mar 10, 2005 1:10 PM (in response to enterprisejavabones)In the EJB 2.1 specification see section 7.8 'Stateless Session Bean' paragraph 4.