• 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
  • Jeanne Boyarsky
  • Tim Cooke
Sheriffs:
  • Bear Bibeault
  • Henry Wong
  • Devaka Cooray
Saloon Keepers:
  • salvin francis
  • Tim Moores
  • Tim Holloway
  • Stephan van Hulst
  • Frits Walraven
Bartenders:
  • Jj Roberts
  • Carey Brown
  • Scott Selikoff

ejbCreate/ejbRemove for stateless bean

 
Greenhorn
Posts: 1
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I've read that in this callback methods it is possible to take a reference to EJBObject throught SessionContext (table 3 page 90 in spec). But how it can be possible, if this methods are called by the container to change a size of the pool. so there is no client and no EJBObject (figure 15 and 16 on page 94). thanks in advance for help

bo
 
Ranch Hand
Posts: 39
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I cannot figured out either, the reason.

Anyone???

 
Greenhorn
Posts: 2
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Sometimes asking gut question give a good result: with 97% I've passed the exam. But still I don't know the answer...

regards
 
Greenhorn
Posts: 7
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
There is a good explanation for this. And remember the SessionContext is still available from those methods.

https://coderanch.com/t/158485/java-EJB-SCBCD/certification/beanness-stateless-session-bean.
 
Ranch Hand
Posts: 116
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Originally posted by Tomek Bo:
I've read that in this callback methods it is possible to take a reference to EJBObject throught SessionContext (table 3 page 90 in spec). But how it can be possible, if this methods are called by the container to change a size of the pool. so there is no client and no EJBObject (figure 15 and 16 on page 94). thanks in advance for help

bo



There is always an EJBObject for anything that has a remote component interface. (Local component interface as well, I believe). Just because the diagram may not show you it, each bean in a pool has an associated EJBObject. Also, ejbRemove() is called just before a bean is removed from the pool, (it's your last chance to clean it up theoretically), and at that point the EJBObject still exists for it. One more point, all objects in a pool are on the heap, and as such are real objects, they also have a partner object, the EJBObject. (Often not shown in pool diagrams for simplicity, since it's confusing to remember that the EJBObject actually stands in for the bean).
I believe this is how it works.
-jeff
 
Consider Paul's rocket mass heater.
reply
    Bookmark Topic Watch Topic
  • New Topic