Rickard �berg wrote:
> 
> Hey
> 
> Juha Lindfors wrote:
> > the spec says for session bean class that it is not allowed to define the
> > finalize() method (6.10.2).
> >
> > But what about the superclass? There's going the be a finalize method
> > somewhere, at least on the Object class. Why can't the session bean class
> > define the finalize() method then?
> 
> Just guessing here, but I don't think that you can assume in general
> that it will be called. At all. That's probably the main reason. Any
> cleanup code should be done in ejbRemove or unsetEntityContext.

I believe that the 1.2 VM spec requires finalizers to be called,
eventually. However, in an EJB, the implementation object might be
pooled, in which case it could 'be' a number of different 'beans' (as
different state gets swapped in and out), so the eventual call to
finally would be pretty much useless.

> 
> /Rickard
> 
> --
> Rickard �berg
> 
> @home: +46 13 177937
> Email: [EMAIL PROTECTED]
> http://www.telkel.com
> http://www.jboss.org
> http://www.dreambean.com

Reply via email to