Important Notice: Our web hosting provider recently started charging us for additional visits, which was unexpected. In response, we're seeking donations. Depending on the situation, we may explore different monetization options for our Community and Expert Contributors. It's crucial to provide more returns for their expertise and offer more Expert Validated Answers or AI Validated Answers. Learn more about our hosting issue here.

Should EJB instances set their references to null inside ejbRemove (for clean up)?

0
Posted

Should EJB instances set their references to null inside ejbRemove (for clean up)?

0

After ejbRemove() entity beans go in a ‘passive’ state, and just like in ejbPassivate, there is no reason to set their references to null, but it’s a good idea if they close all open connections. Session beans stop their existence after ejbRemove(), so they MUST close all open resources. The ejb instances will be garbage collected so there is no need to set their references to null, but if an open resource remains it may never be released.

Related Questions

What is your question?

*Sadly, we had to bring back ads too. Hopefully more targeted.