• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Home interface of Stateless Session Bean

 
John Liang
Greenhorn
Posts: 29
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hello,
We all know that in the Home interface of Stateless Session Bean, we cannot have a create method with arguments. That means the method signature must be:

However, can we have this? :

It seems to me it makes perfect sense to have this, however, according to what I see in the spec, it has not mentioned anything about create<METHOD> in Stateless Session Bean. That only happens on Stateful Session Bean.
Please confirm my findings.
Thanks in advance,
John
 
Nauman Khan
Ranch Hand
Posts: 49
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,

// This is proper for Stateless Session Beanpublic StatelessSessionBean create () throws CreateException, RemoteException;// Is this proper for Stateless Session Bean?public StatelessSessionBean createSomething () throws CreateException, RemoteException;

This is not legal as per spec., I think you should read 7.10.6 and 7.10.8 on page 97 and 98 in EJB Spec. So, You can write only one create method with no argument in stateless bean home interface.
Regards,
[ December 13, 2003: Message edited by: Nauman Khan ]
 
Vladas Razas
Ranch Hand
Posts: 385
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Actually it did mention. And a lot of times. Only one parameterless create() in stateless beans. If you see another create<XXX> it does mean this bean can be only stateful. At least by the book.
The trouble learning EJB and trouble using it... There are a lot of things nobody will complain about. Compilers... those don't care about your beans, a lot of mistakes might be passed through deployment tools too. You will be able even to make bad things running on some containers.
 
John Liang
Greenhorn
Posts: 29
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hello,
Thanks guys. I got it in the spec. I have also found it in HFEJB on page 125, "Rules for the home interface". I miss that whole thing ... ...
Thanks for your help,
John
[ December 14, 2003: Message edited by: John Liang ]
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic