Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

Panel

"Stateless session beans are session beans whose instances have no conversational state. This means that all bean instances are equivalent when they are not involved in servicing a client-invoked method. The term 'stateless' signi?es that an instance has no state for a specific client."

What this means is quite simply that stateless beans are shared. They do in fact have state as you can assign values to the variables, etc. in the bean instance. The only catch is you are not guaranteed to get the same instance on every call so the state of whatever instance may or may not be useful to you. This is identical to checking out a book from the library or renting a movie from the video store. You are essentially checking out or renting a new bean instance on each method call.

With EJB 3.0, it's now possible to write stateless session bean without specifying a deployment descriptor; you basically have to write just a remote or local business interface, which is a plain-old-java-interface, annotated with the @Remote or @Local annotation the stateless session bean implementation, a plain-old-java-object which implements the remote or the local business interface and is annotated with the @Stateless annotation

...