• 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 Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

Example when to use @statefull

 
Ranch Hand
Posts: 1402
3
Netbeans IDE Spring Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi

could anyone give me a simple real life example of when using @stateful, please? It is just on order to understand it better

Also which is the benefit of using EJB 3 / Hibernate instead of using EJB 3 and his anotations?

Thanks
 
Greenhorn
Posts: 7
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
@Stateful is a kind of session bean which keeps a state during its lifetime. The simplest example is a shopping basket. The client can invoke this bean several times and every time a request will go to the same bean (so he can check its state).

which is the benefit of using EJB 3 / Hibernate instead of using EJB 3 and his anotations?



"EJB 3 and his anotations" --> EJB 3 is a specification and it contains specification of JPA 2.0 and that's it, nothing more. Hibernate is an implementation of JPA so it should be the same. The true is that each vendor wants to be better than others and they added some extra feature. So Hibernate is more powerful than specified JPA. The same is with the EJB implementations.
 
reply
    Bookmark Topic Watch Topic
  • New Topic