This week's book giveaway is in the Cloud/Virtualization forum.
We're giving away four copies of Pipeline as Code and have Mohamed Labouardy on-line!
See this thread for details.
Win a copy of Pipeline as Code this week in the Cloud/Virtualization forum!
  • 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
  • Ron McLeod
  • Paul Clapham
  • Jeanne Boyarsky
  • Bear Bibeault
Sheriffs:
  • Rob Spoor
  • Henry Wong
  • Liutauras Vilda
Saloon Keepers:
  • Tim Moores
  • Carey Brown
  • Stephan van Hulst
  • Tim Holloway
  • Piet Souris
Bartenders:
  • Frits Walraven
  • Himai Minh
  • Jj Roberts

Differentiate stateless and stateful

 
Ranch Hand
Posts: 577
Tomcat Server Notepad Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi,

Is a bean called stateless if it has single method? Is this criteria in determining a bean stateless or stateful? Can we find from a program whether the bean used stateless or stateful? Please clarify my doubts.

Thanks and regards,
Narendranath.
 
Ranch Hand
Posts: 209
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Naren,

Stateless sb - a session bean that does not maintain a conversational state with the client (i.e. same bean instance can be used by different clients)

Stateful sb - a session bean that maintains a conversational state with the client (i.e. bean instance will only service a client who created it)

Looks like you want to read "Head First EJB"

Hope it helps.
 
Naren Chivukula
Ranch Hand
Posts: 577
Tomcat Server Notepad Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi,

Before I went through your reply I have already read the topics thorougly. Anyhow I thank u for sending reply. Can u list out some sites which have stateful session bean examples and entity bean examples. I tried for them but in vain.

Thanking you,
Narendranath.
 
Ranch Hand
Posts: 312
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Originally posted by Naren Chivukula:
Hi,

Is a bean called stateless if it has single method? Is this criteria in determining a bean stateless or stateful? Can we find from a program whether the bean used stateless or stateful? Please clarify my doubts.

Thanks and regards,
Narendranath.



1. Stateful session bean maintains the Beans state in between the method invocations.
2.Choosing the type of session bean is not about the number of methods present in the bean.

Consider that the bean present with only one method. Client wants to call the same method again and again and he wants to maintain the state between the method invocation then in that case you have to go for stateful session bean. Otherwise you can go for stateless session bean as Stateless will be faster than Stateful session bean.

Regards,
M.S.Raman
 
Water! People swim in water! Even tiny ads swim in water:
SKIP - a book about connecting industrious people with elderly land owners
https://coderanch.com/t/skip-book
reply
    Bookmark Topic Watch Topic
  • New Topic