permaculture playing cards*
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


Win a copy of OCA/OCP Java SE 7 Programmer I & II Study Guide this week in the OCPJP forum!
JavaRanch » Java Forums » Java » EJB and other Java EE Technologies
Bookmark "Stateful session beans " Watch "Stateful session beans " New topic
Author

Stateful session beans

Gurumurthy Ramamurthy
Ranch Hand

Joined: Feb 13, 2003
Posts: 272
Hi,

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

Joined: Jan 26, 2005
Posts: 22
Hi,

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
All,

what exactly is meant by " reentrant"?

D.


SCJP, SCEA
Bhanu
Ranch Hand

Joined: Dec 05, 2004
Posts: 48
Exactly..my 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:

EntityA:

methodA() {
entityB.methodB((EntityA)ctx.getEJBObject());
}

EntityB:

methodB(EntityA entityA) {
entityA.someMethod();
}


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?

D.
ravi janap
Ranch Hand

Joined: Nov 04, 2000
Posts: 389
Hi

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.

Thanks

-- Ravi


SCJP, SCJD, SCWCD, SCBCD, SCEA
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
Sheriff

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: http://aspose.com/file-tools
 
subject: Stateful session beans