Book Image

EJB 3 Developer Guide

By : Michael Sikora
Book Image

EJB 3 Developer Guide

By: Michael Sikora

Overview of this book

Table of Contents (18 chapters)
EJB 3 Developer Guide
Credits
About the Author
About the Reviewers
Preface
Annotations and Their Corresponding Packages

Chapter 2. Session Beans

Session Beans are an EJB technology for encapsulating business processes or workflow. In this chapter we will cover the following topics:

  • Stateless session beans

  • Stateful session beans

  • Annotations

  • Packaging and Deploying a session bean

  • Running a session bean client from the application client container

  • Stateless and Stateful session bean lifecycles

Introduction

In object-oriented analysis and design a control class encapsulates business logic for a use case. Session beans are used to implement such control classes. Check credit card details, transfer funds, and book reservation are examples of potential session bean candidates. Session beans are transient and relatively short lived. In particular, session beans are not persistent; they are not stored in a database or other permanent file system. Session beans can create and update entities, which are persistent, as we shall see in the following chapters.

A client interacts with a session bean by invoking one or more methods...