• 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
  • Tim Cooke
  • paul wheaton
  • Jeanne Boyarsky
  • Ron McLeod
Sheriffs:
  • Paul Clapham
  • Liutauras Vilda
  • Devaka Cooray
Saloon Keepers:
  • Tim Holloway
  • Roland Mueller
Bartenders:

ejbRemove( ) Pls Help

 
Greenhorn
Posts: 20
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
When client call remove() on a passivated stateful session bean, will container call ejbRemove() before killing the bean. Can someone help me as this is not in the HFEJB ?
 
Ranch Hand
Posts: 372
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
yes, This was clarified by Kathy Sierra in this forum some 3 years back. The gist of it is : If a client calls remove on a passivated stateful session bean, the call will be treated just like a business method call. This is because a client calling remove() means the association between the client and the bean is not yet over. ie the bean might still do some things for the client. Hence the container activates the bean, then calls ejbActivate() and then calls ejbRemove() and then removes the bean. But if the bean times out while passivated, the relationship between the bean and the client is considered to be over and the bean will be removed without getting activated hence will miss an ejbRemove() call.
 
Ranch Hand
Posts: 445
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Sathish,
What does this mean " But if the bean times out while passivated,..." Is passivated bean can timed out? how can we set this time??
 
B.Sathish
Ranch Hand
Posts: 372
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
hey Rizwan,
Looks like you have not come to the 4th chapter in HFEJB yet. This will be clear after you read that, where you will come across the stateful bean lifecycle. A stateful bean can timeout when in the passivated state and go to the "does not exist" state. The server has to do this for scalability. It can't keep the bean around for ever waiting for the client to come back.If there is no activity for quite some time, the server would normally passivate the bean first. If there is still further inactivity for some more time, the bean would be destroyed permanently with no hope of recovery. This is what we call "time out while passivated" . This of course does not mean that every bean has to be passivated first before timing out. The logistics is upto the container and it may timeout the bean when it is in the "method-ready" state also and send it to "does not exist" state .(Refer Stateful session bean lifecycle in 4th chapter)

Regarding setting the time-out values, the specification does not talk about setting time-out or any other passivation parameters such as memory, no of max beans etc, but most vendors will give you a way to manipulate these. When I was reading, I too thought there will be a way to set the time-out in the DD like HttpSession , but that's not the case. Chapter 4 talks about all this very clearly.
 
Rizwan Mohammad
Ranch Hand
Posts: 445
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Thanks a lot for your detail explanation Satheesh. Yeah I havent yet come to 4th Chapter. It is going really slow to me these days.. I need to pick up fast.
 
B.Sathish
Ranch Hand
Posts: 372
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
It takes some time to come out of the "JSP/Servlet" mindset . I think the first 2 chapters are the toughest to get through in HFEJB, if you are somewhat new to EJB's. After that you'll have a cruise. By the end of chapter 10, you'll have an overwhelming feeling, but at that time, you have come too far to give up

Good Luck
 
reply
    Bookmark Topic Watch Topic
  • New Topic