I am testing a Message Driven Bean. Please at what point does the EJBRemove() method gets called. Because i am planning to open a database connection in the ejbCreate() method and also add code to close the connection in the ejbremove method
Abiodun, See the bottom of Sun's tutorial for the lifecyle of an MDB. Basically ejbRemove() gets called when the container decides it is done with bean and wants to make it available for garbage collection.
That's a long time to keep a connection open. Since an MDB is stateless, the time between ejbCreate and ejbRemove could be days. Or even longer!