I'm in the process of migrating an EJB 2 application to EJB 3 (and what a satisfying task it is to delete all those deployment descriptors!). It used to run on Weblogic and now runs on Glassfish.
The task is going very smoothly, but one thing makes me wary: The current code takes great care to ensure that EJBObject.remove()
is called on the bean when it's done its job, and other developers have (unfortunately very vague) memories of "bad things" happening when that was not done.
However, with EJB3, the implementation class does not implement EJBObject
, so there is no remove()
method to be called. And my understanding is that there isn't really any point at all in calling it on stateless session beans, since they are, well, stateless.
Could these "bad things" have been weblogic-specific? If not, what else? Should I avoid the full EJB3 lightweightness and keep a remote interface that extends EJBObject
? Or just write it off as cargo-cult programming and delete all those try/finally clauses?
I'm leaning towards the latter, but not feeling very comfortable with it.
EJBObject
, does the container return a direct reference of a local bean to a local client? If so, there are dangers like the client can assign anull
value to same and pool instances will disappear from SLSB pools. If client calls are routed through a proxy as in EJB 2.1, what is such a proxy type? – lupchiazoemnull
would'nt disappear it from pool. By, 'disappear' I mean it would be ready for GC as per runtime. I had posted a question @ stackoverflow.com/questions/51657404/…. I request you to share your know inputs there. – lupchiazoem