blob: 18a4ea59218af3a0295b6ac2d5c1da1242932ae0 [file] [log] [blame]
<?xml version="1.0" encoding="UTF-8"?><!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html lang="en-us" xml:lang="en-us">
<head>
<meta content="text/html; charset=utf-8" http-equiv="Content-Type" />
<meta name="copyright" content="Copyright (c) 2000, 2008 IBM Corporation and others. All rights reserved. This program and the accompanying materials are made available under the terms of the Eclipse Public License v1.0 which accompanies this distribution, and is available at https://www.eclipse.org/legal/epl-2.0/. Contributors: IBM Corporation - initial API and implementation" />
<meta name="DC.rights.owner" content="(C) Copyright 2000, 2008" />
<meta content="public" name="security" />
<meta content="index,follow" name="Robots" />
<meta http-equiv="PICS-Label" content='(PICS-1.1 "http://www.icra.org/ratingsv02.html" l gen true r (cz 1 lz 1 nz 1 oz 1 vz 1) "http://www.rsac.org/ratingsv01.html" l gen true r (n 0 s 0 v 0 l 0) "http://www.classify.org/safesurf/" l gen true r (SS~~000 1))' />
<meta content="concept" name="DC.Type" />
<meta name="DC.Title" content="Session Beans" />
<meta name="abstract" content="" />
<meta name="description" content="" />
<meta content="session beans, overview" name="DC.subject" />
<meta content="session beans, overview" name="keywords" />
<meta scheme="URI" name="DC.Relation" content="../topics/sessbwiz.html" />
<meta content="XHTML" name="DC.Format" />
<meta content="sessb" name="DC.Identifier" />
<meta content="en-us" name="DC.Language" />
<link href="../../../org.eclipse.wst.doc.user/common.css" type="text/css" rel="stylesheet" />
<title>Session Beans</title>
</head>
<body id="sessb"><a name="sessb"><!-- --></a>
<h1 class="topictitle1">Session Beans</h1>
<div><p />
<p>A <strong>session bean</strong> is a type of enterprise bean. It is created by a
client and usually exists only for the duration of a single client-server
session.</p>
<p>Session beans are useful for describing interactions between other beans
(taskflow) and for implementing particular tasks. They do not represent data
in the database, but they can access data, so we can use session beans to
read, update, and insert data in a business process. Session beans access
data that spans concepts, is not shared, and is usually read-only. Session
beans contain business logic, and entities model persistent data. There are
three types of session beans: stateless, stateful and singleton. </p>
<ul>
<li><strong>Stateless session beans</strong> <p>A stateless session bean is pooled by
the container to handle multiple requests from multiple clients and does not
maintain any conversational state.</p>
</li>
<li> <strong>Stateful session beans</strong> <p>A stateful session bean acts on behalf
of a single client and maintains client-specific session information (called
conversational state) across multiple method calls and transactions. It exists
for the duration of a single client/server session.</p>
</li>
<li> <strong>Singleton session beans</strong> <p>A Singleton session bean is a session
bean component that is instantiated once per application. In cases where the container
is distributed over many virtual machines, each application will have one bean instance
of the Singleton for each JVM.</p>
</li>
</ul>
</div>
<div>
<div class="familylinks">
<div class="parentlink"><strong>Parent topic:</strong> <a href="../topics/sessbwiz.html" title="You can use a wizard to create a session bean and add it to your project.">Creating EJB Session Beans</a></div>
</div>
</div>
</body>
</html>