• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Paul Clapham
  • Ron McLeod
  • Jeanne Boyarsky
  • Tim Cooke
Sheriffs:
  • Bear Bibeault
  • Henry Wong
  • Devaka Cooray
Saloon Keepers:
  • salvin francis
  • Tim Moores
  • Tim Holloway
  • Stephan van Hulst
  • Frits Walraven
Bartenders:
  • Jj Roberts
  • Carey Brown
  • Scott Selikoff

A Question asked during interview

 
Ranch Hand
Posts: 200
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hello all,

I have a Question that was asked during interview.
Suppose i write a Stateful session bean. But in the deployment descriptor i mention it as "STATELESS". what will happen?
What i answered is that : The code will still compile. But the bean will still behave as a Stateless one, coz that how its set in the Deployment descriptor.
Am i right? Any answers on this?

Regards,
Sajee
 
Ranch Hand
Posts: 270
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
From EJB spec 7.8

The home interface of a stateless session bean must have one create method that takes no arguments.
The create method of the remote home interface must return the session bean�s remote interface. The
create method of the local home interface must return the session bean�s local interface. There can be
no other create methods in the home interface. The session bean class must define a single ejbCreate
method that takes no arguments.



1. Compilation is not of consideration since you are talking about deployment. (i.e. you must have first successfully compiled all the source before you proceed to deployment). BTW, compilation has nothing to do with the DD and as per java rule, stateless and stateful bean class files are of no difference at all -- they extend/implement the same classes/interfaces.
2.a. If your statefull bean happened to have only one create method without any argument just as per stateless bean, it will behave like a stateless bean.
2.b. Else, it may lead to direct deployment failure or ...... who knows ...... since it is not expicilitly expressed in the spec.
[ June 14, 2004: Message edited by: Yi Meng ]
 
look! it's a bird! it's a plane! It's .... a teeny tiny ad
the value of filler advertising in 2021
https://coderanch.com/t/730886/filler-advertising
reply
    Bookmark Topic Watch Topic
  • New Topic