• 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
  • Bear Bibeault
  • Ron McLeod
  • Jeanne Boyarsky
  • Paul Clapham
Sheriffs:
  • Tim Cooke
  • Liutauras Vilda
  • Junilu Lacar
Saloon Keepers:
  • Tim Moores
  • Stephan van Hulst
  • Tim Holloway
  • fred rosenberger
  • salvin francis
Bartenders:
  • Piet Souris
  • Frits Walraven
  • Carey Brown

Can I override session bean type in the deployment descriptor?

 
Ranch Hand
Posts: 126
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
For instance, there is a stateless session bean annotated with "@Stateless", can I override it to a stateful session bean via the deployment descriptor?

"Type-level, method-level, and field-level annotation can all be overridden by the deployment descriptor.", is this true?
 
Mellon Sun
Ranch Hand
Posts: 126
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
<enterprise-beans>
<session>
<ejb-name>StatelessSBBean</ejb-name>
<ejb-class>com.mellon.StatelessSBBean</ejb-class>
<session-type>Stateful</session-type>
</session>
</enterprise-beans>

It works with the descriptor snippet above, the StatelessSBBean is annotated with @Stateless, how could I confirm the StatelessSBBean is running as an Stateful Session Bean exactly? After all, there is not a
method like "isStateless" or "getSessionType" exists.

And, anyone can cite a case need this?
 
Greenhorn
Posts: 22
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
No.

Not all annotations are overridable.

Session bean types like @Stateful or @Stateless cant be overridden via a descriptor.
 
Greenhorn
Posts: 3
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
If you refer Mikalai Zaikin notes , you can find the following notes in Chapter 1

" Keep in mind not all annotations are overridable
e.g., Session bean type (Stateful vs. Stateless) can't be overridden"
    Bookmark Topic Watch Topic
  • New Topic