• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Bear Bibeault
  • Ron McLeod
  • Jeanne Boyarsky
  • Paul Clapham
Sheriffs:
  • Tim Cooke
  • Liutauras Vilda
  • Junilu Lacar
Saloon Keepers:
  • Tim Moores
  • Stephan van Hulst
  • Tim Holloway
  • fred rosenberger
  • salvin francis
Bartenders:
  • Piet Souris
  • Frits Walraven
  • Carey Brown

Stateful session beans

 
Ranch Hand
Posts: 273
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,

Stateful session beans can't be reentrant, is it? Why?
 
Greenhorn
Posts: 22
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,

only Entity Beans can be reentrant.

It is in the specification, session and MDB cannot be reentrant.
 
Ranch Hand
Posts: 98
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Session Beans(both stateful and stateless) can not be reentrant because
a session bean can serve only one client at a time.
 
Ranch Hand
Posts: 223
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
All,

what exactly is meant by " reentrant"?

D.
 
Ranch Hand
Posts: 48
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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.
 
Ranch Hand
Posts: 211
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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();
}
 
David Follow
Ranch Hand
Posts: 223
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi all,

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

D.
 
Ranch Hand
Posts: 389
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
 
ravi janap
Ranch Hand
Posts: 389
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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..............
 
Sheriff
Posts: 5782
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Another good topic for EJB/J2EE forum. Moving this thread there...
 
Don't get me started about those stupid light bulbs.
    Bookmark Topic Watch Topic
  • New Topic