Skip to content

Stateful vs Stateless Session Bean

December 15, 2010

There are actually three kinds of EJBs: session beans, entity beans, and message-driven beans

There are two types of session beans, which are defined by their use in a client interaction:

Stateful Bean:

  • is deployed with the declarative attribute “stateful
  • caches client conversation in memory
  • useful if the business process spans over multiple requests (needed of a conversation)
  • acts as a server-side extension of the client that uses it, managing the interaction of other beans and performing work on behalf of the client application

Stateless Bean:

  • is deployed with the declarative attribute “stateless
  • do not maintain conversational state specific to a client session
  • each business method represents an isolated independent service
Advertisements

From → EJB, JAVA

Leave a Comment

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: