Forums Register Login

Stateless Session Bean should it be container managed or a Bean managed

+Pie Number of slices to send: Send
Hi

All..... My question is for using the statless container managed Is there is any need to call the ejbRemove() method will it be explicitly called for the Conatainer managed Bean Once after creating an instance of it.

What happens Should i call the ejbRemove() method every time i create an instance for an Bean Managed EJB to return the instance to the pool or it will be the same as with the Container managed EJB


Mukesh
+Pie Number of slices to send: Send
I suppose your question is relating to using CMP or BMP in stateless session Beans and not whether stateless session bean should be BMT or CMT.

calling remove() for both CMP or BMP will delete record in database, however in BMP you write the sql to delete the record while in CMP you don't have to.

in both BMP and CMP you need to call remove() to delete the record and after that the bean instance is sent to pool.
+Pie Number of slices to send: Send
I'm new to EJBs, so could someone please explain to me why a stateless session bean would be either BMP or CMP? The P stands for persistence, right? What's there to persist in a stateless session bean? Or even a stateful one for that matter - the "state" is similar to the session attribute scope, isn't it?
+Pie Number of slices to send: Send
hi
if u call ejbRemove() it has no effect on stateless session bean... after each business call the bean automatically returns to the pool... so no use in calling it and the container wont bother.

in stateful session... ur call to ejbRemove() results in the execution of the code there(like resource release) and the bean getting destroyed... so u do need to call ejbRemove() for the stateless beans.

The CMP and BMP of entity bean is entirely different from this... there calling ejbRemove() results in the deletion of the entity in the underlying data store.

Hope this helps
Sometimes you feel like a nut. Sometimes you feel like a tiny ad.
a bit of art, as a gift, the permaculture playing cards
https://gardener-gift.com


reply
reply
This thread has been viewed 694 times.
Similar Threads
ejbRemove - invoked on local call?
7.6.3 -- Missed ejbRemove() calls and Release of Resources
Question about remove() method of the Session bean
EJB file descriptor for the Stateless Bean
What exception will be thrown if ejbRemove() is called in onMessage method?
More...

All times above are in ranch (not your local) time.
The current ranch time is
Mar 28, 2024 02:25:16.