• 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
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

on ejbRemove() method...

 
Ranch Hand
Posts: 273
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Guys,

I have a simple EJB bean class.

import javax.ejb.*;
public class HelloBean implements javax.ejb.SessionBean
{
private SessionContext ctx;

public void ejbCreate()
{
System.out.println("ejbCreate()");
}

public void ejbRemove()
{
System.out.println("ejbRemove()");
}

public void ejbActivate()
{
System.out.println("ejbACtivate()");
}

public void ejbPassivate()
{
System.out.println("ejbPassivate()");
}

public void setSessionContext(javax.ejb.SessionContext ctx)
{
this.ctx=ctx;
}

public String hello()
{
System.out.println("Hello World EJB");
return "Hello World EJB return this time with SUNIL";
}
}

When I invoke my client, it displays the string from ejbCreate() but the string inside the ejbRemove() method is not at all called. WHY?

Thanks,
Guru
 
Greenhorn
Posts: 15
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
In Session Beans,the ejbRemove() can be called by the container at any time.The bean could be returned back to the pooled state or it can be removed.This implementation would be container specific.

This has been clearly specified in Ed Roman as follows -
Note that some containers will give slightly different outputs than others - it is all implementation specific and is part of EJB product documentation.
We need to keep this in mind while debugging.

Hope this helps.
 
Consider Paul's rocket mass heater.
reply
    Bookmark Topic Watch Topic
  • New Topic