File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
The moose likes EJB and other Java EE Technologies and the fly likes Stateful session beans Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » EJB and other Java EE Technologies
Bookmark "Stateful session beans " Watch "Stateful session beans " New topic

Stateful session beans

Gurumurthy Ramamurthy
Ranch Hand

Joined: Feb 13, 2003
Posts: 273

Stateful session beans can't be reentrant, is it? Why?
Gustavo Dutra

Joined: Jan 26, 2005
Posts: 22

only Entity Beans can be reentrant.

It is in the specification, session and MDB cannot be reentrant.
Vaithiya Sundaram
Ranch Hand

Joined: Apr 22, 2004
Posts: 98
Session Beans(both stateful and stateless) can not be reentrant because
a session bean can serve only one client at a time.

Vaithiyanathan Sundaram<br />SCJP, SCBCD, SCEA part1
David Follow
Ranch Hand

Joined: Oct 16, 2001
Posts: 223

what exactly is meant by " reentrant"?


Ranch Hand

Joined: Dec 05, 2004
Posts: 48 doubt is also the same. I do remember about reentrent code/programs in Operating Systems literature. I really don't know(understand) what does that mean.
I would appreciate if any one enlighten us on this.

Thanks,<br />Bhanu<br />SCEA Step-I<br />SCBCD for J2EE 1.3<br />SCJP1.4
Keerthi P
Ranch Hand

Joined: Aug 19, 2003
Posts: 203
This property specifies whether an entity bean instance should allow loop-back call sequences, which are call sequences where one of the bean's methods calls another bean's method which in turn calls a method in the calling bean instance.

Here is an example:


methodA() {


methodB(EntityA entityA) {

Cheers.<br />Keerthi<br />(SCJP, SCWCD, SCBCD)
David Follow
Ranch Hand

Joined: Oct 16, 2001
Posts: 223
Hi all,

I understand, but what are the exact implications of it?
Why does the spec. explicitly forbid it?

ravi janap
Ranch Hand

Joined: Nov 04, 2000
Posts: 389

It is relevant in case of entity beans with container-managed relationships with each other. The "reentrant" property lets a calling bean to in turn allow loopback call on its methods by the called bean.


-- Ravi

ravi janap
Ranch Hand

Joined: Nov 04, 2000
Posts: 389
Why is it not allowed in Session Bean is explained by Specs:

The container must ensure that only one thread can be executing an instance at any time. Note that a session object is intended to support only a single client. Therefore, it would be an application error if two clients attempted to invoke the same session object. One implication of this rule is that an application cannot make loopback calls to a session bean instance..............
Ajith Kallambella

Joined: Mar 17, 2000
Posts: 5782
Another good topic for EJB/J2EE forum. Moving this thread there...

Open Group Certified Distinguished IT Architect. Open Group Certified Master IT Architect. Sun Certified Architect (SCEA).
I agree. Here's the link:
subject: Stateful session beans
It's not a secret anymore!