• 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
  • Rob Spoor
  • Tim Cooke
  • Junilu Lacar
Sheriffs:
  • Henry Wong
  • Liutauras Vilda
  • Jeanne Boyarsky
Saloon Keepers:
  • Jesse Silverman
  • Tim Holloway
  • Stephan van Hulst
  • Tim Moores
  • Carey Brown
Bartenders:
  • Al Hobbs
  • Mikalai Zaikin
  • Piet Souris

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.
 
You showed up just in time for the waffles! And this tiny ad:
Building a Better World in your Backyard by Paul Wheaton and Shawn Klassen-Koop
https://coderanch.com/wiki/718759/books/Building-World-Backyard-Paul-Wheaton
reply
    Bookmark Topic Watch Topic
  • New Topic