Win a copy of The Little Book of Impediments (e-book only) this week in the Agile and Other Processes forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

SLSB

 
Amandeep Singh
Ranch Hand
Posts: 850
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
A stateless session bean cannot access resource managers in a @PostConstruct method.
A stateless session bean cannot access resource managers in @PostCreate().
A stateless session bean cannot access resource managers in @Remove methods.

I agree with 3rd statement, but how can i agree with 1st and 2nd statement's.
There should be no implication accessing in these methods.
 
Joe Harry
Ranch Hand
Posts: 10128
3
Eclipse IDE Mac PPC Ubuntu
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Does the container recognize the @Remove callback for a Stateless session bean?
 
Amandeep Singh
Ranch Hand
Posts: 850
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
thanks Jothi for your reply. That's why i have mentioned. I understand that 3rd statement is not possible. But why the first and second statement's are true.

 
Mihai Radulescu
Ranch Hand
Posts: 918
IntelliJ IDE Java Linux
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi Amandeep

From where you have this statements ?

About the PostConstruct -> it occurs after the dependency injection nad I think you have access to the resource manager.
About the PostCreate -> I am not shore if the PostCreate is a standard EJB annotation.


Regards
M
 
Amandeep Singh
Ranch Hand
Posts: 850
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
i do have these statement's from Enthuware explanation. If you need question, i can post for you.
 
Mihai Radulescu
Ranch Hand
Posts: 918
IntelliJ IDE Java Linux
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi Amandeep,


The question will help me to understand the better the problem, can you send it ?
 
Karnati Sudhakar
Ranch Hand
Posts: 270
Eclipse IDE Ubuntu
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
A stateless session bean cannot access resource managers in a @PostConstruct method.
A stateless session bean cannot access resource managers in @PostCreate().
A stateless session bean cannot access resource managers in @Remove methods.


4.5.2 section of the specification document should clarify this question a little bit.

Regards
Sudhakar
 
Amandeep Singh
Ranch Hand
Posts: 850
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanks Sudhakar- i should have hesitated to look in Specf.'s first.

Page 88 from core specf.-

PostConstruct, Pre-
Destroy lifecycle callback
interceptor
methods

can have access to these methods SessionContext methods: getBusinessObject,
getEJBHome, getEJBLocal-
Home, getEJBObject,
getEJBLocalObject,getTimerService,
lookup
JNDI access to java:comp/env
EntityManagerFactory access for CMT and SessionContext methods: getBusinessObject,
getEJBHome, getEJBLocal-
Home, getEJBObject,
getEJBLocalObject, getUserTransaction,
getTimerService, lookup
JNDI access to java:comp/env
EntityManagerFactory access for BMT.

If a session bean instance attempts to access a resource manager, an enterprise bean, an entity manager
or entity manager factory, and the access is not allowed, the behavior is undefined by the EJB
architecture.

I got it, for you other guys i will post the question by evening.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic