Win a copy of High Performance Python for Data Analytics this week in the Python forum!
  • 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
  • Paul Clapham
  • Ron McLeod
  • Bear Bibeault
  • Liutauras Vilda
Sheriffs:
  • Jeanne Boyarsky
  • Tim Cooke
  • Junilu Lacar
Saloon Keepers:
  • Tim Moores
  • Tim Holloway
  • Stephan van Hulst
  • Jj Roberts
  • Carey Brown
Bartenders:
  • salvin francis
  • Frits Walraven
  • Piet Souris

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

 
Greenhorn
Posts: 22
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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~
 
Ranch Hand
Posts: 65
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi Magnus,
I got it. Thanks very much!!
 
Ranch Hand
Posts: 128
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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.
 
Ranch Hand
Posts: 59
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
reply
    Bookmark Topic Watch Topic
  • New Topic