aspose file tools
The moose likes EJB and other Java EE Technologies and the fly likes Example when to use @statefull Big Moose Saloon
  Search | Java FAQ | Recent Topics
Register / Login


Win a copy of The Mikado Method this week in the Agile and other Processes forum!
JavaRanch » Java Forums » Java » EJB and other Java EE Technologies
Reply Bookmark "Example when to use @statefull" Watch "Example when to use @statefull" New topic
Author

Example when to use @statefull

Angus Ferguson
Ranch Hand

Joined: Jun 22, 2012
Posts: 240
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
Michal Nalewajko
Greenhorn

Joined: Mar 07, 2013
Posts: 7
@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.
 
I agree. Here's the link: http://ej-technologies/jprofiler - if it wasn't for jprofiler, we would need to run our stuff on 16 servers instead of 3.
 
subject: Example when to use @statefull
 
Similar Threads
is PortableRemoteObject. really needed?
Help me Authors of Pro EJB 3.0
EJB3 & JDK1.4
how to create ActionBazaar application given in Manning Ejb 3 in action in eclipse juno ?
EJB2.0 or EJB3.0?