• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Why ejbCreate and ejbRemove on a stateless bean cannot ...

 
Kuo-Feng Sun
Greenhorn
Posts: 22
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Dear all,
I am confused with this rule. The chapter about stateless session bean says ejbCreate() and ejbRemove cannot access antoher bean's methods and resource manager.
Why a stateful session bean can, but a stateless session bean cannot?
Thanks~
 
Magnus Stattin
Ranch Hand
Posts: 65
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
To have this access you have to be in a transactional context OR have a client security context.
In ejbCreate and ejbRemove in a session bean you do not have a transactional context.
In a stateful session bean you do have a client security context in ejbCreate and ejbRemove as opposed to in a stateless session bean.
That gives you access in a stateful session bean, but not in a stateless.

/Hope it helps
Magnus
[ January 29, 2004: Message edited by: Magnus Stattin ]
 
Kuo-Feng Sun
Greenhorn
Posts: 22
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi Magnus,
I got it. Thanks very much!!
 
Zee Ho
Ranch Hand
Posts: 128
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
To have this access you have to be in a transactional context OR have a client security context.


I can not find any description about this concept in the ejb specification. in my mind, the resource manager is the sth like connection factory, then it seems no reason to disallowed the method to use it and if it can not be used it in staeless bean, then how can it access the database?

Sorry, I am new to EJB, please rectify me.
 
bhilla ratna
Ranch Hand
Posts: 59
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi!

In specs, there are tables showing which operations are in each type of ejb and below the table reasons why a particular method is disallowed.

stateless bean age 90,91
statefull bean age 80,81
entity bean: page 179,180
message driven bean: page 320,321

bhilla
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic