Win a copy of Spring in Action (5th edition) this week in the Spring 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
  • Bear Bibeault
  • Devaka Cooray
  • Liutauras Vilda
  • Jeanne Boyarsky
Sheriffs:
  • Knute Snortum
  • Junilu Lacar
  • paul wheaton
Saloon Keepers:
  • Ganesh Patekar
  • Frits Walraven
  • Tim Moores
  • Ron McLeod
  • Carey Brown
Bartenders:
  • Stephan van Hulst
  • salvin francis
  • Tim Holloway

Callback methods in Session beans  RSS feed

 
Ranch Hand
Posts: 10128
3
Eclipse IDE Mac PPC Ubuntu
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
The below quote is from the specs,

PostConstruct callbacks occur after any dependency injection has been performed by the container
and before the first business method invocation on the bean.[/QUOTE

Now if I have an annotation in my session bean that calls another session bean, then do my PostConstruct callback occurs after the another session bean reference is resolved?

 
Ranch Hand
Posts: 244
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
If you are referring to EJB injection, yes, it's true.
But you cannot access those EJBs during PostConstruct method, because there is no transaction/security context.
 
Joe Harry
Ranch Hand
Posts: 10128
3
Eclipse IDE Mac PPC Ubuntu
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

Originally posted by Mirko Bonasorte:
If you are referring to EJB injection, yes, it's true.
But you cannot access those EJBs during PostConstruct method, because there is no transaction/security context.



I did not get your second line?
 
Sheriff
Posts: 14691
16
Eclipse IDE Ubuntu VI Editor
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I didn't get it either Enterprise bean access is allowed in PostContruct methods for stateful sessions beans.
 
Mirko Bonasorte
Ranch Hand
Posts: 244
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Sorry, this is true only for stateless.
 
Ranch Hand
Posts: 210
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,

Any idea as to why is it only true for Stateless?

Rahul
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!