• 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 Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Ron McLeod
  • Tim Cooke
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • Junilu Lacar
  • Rob Spoor
  • Jeanne Boyarsky
Saloon Keepers:
  • Stephan van Hulst
  • Carey Brown
  • Tim Holloway
  • Piet Souris
Bartenders:

SLSB

 
Ranch Hand
Posts: 856
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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.
 
Ranch Hand
Posts: 10198
3
Mac PPC Eclipse IDE Ubuntu
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Does the container recognize the @Remove callback for a Stateless session bean?
 
Amandeep Singh
Ranch Hand
Posts: 856
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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.

 
Ranch Hand
Posts: 918
IntelliJ IDE Java Linux
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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: 856
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi Amandeep,


The question will help me to understand the better the problem, can you send it ?
 
Ranch Hand
Posts: 270
Eclipse IDE Ubuntu
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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: 856
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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.
 
I will open the floodgates of his own worst nightmare! All in a tiny ad:
The Low Tech Laboratory Movie Kickstarter is LIVE NOW!
https://www.kickstarter.com/projects/paulwheaton/low-tech
reply
    Bookmark Topic Watch Topic
  • New Topic