Konstantin,

On 1/5/13 12:52 PM, Konstantin Kolinko wrote:
> 2) Calling PreDestroy methods if init() method fails.
> 
> The specs say that
> - if @PostConstruct methods fail then nothing is called afterwards, and
> - if init() fails then destroy() is not called.
> 
> I wonder whether failure of init() precludes @PreDestroy methods from
> being called. The current implementation is that they are not called.
> 
> I feel some concern as JSR250 and Servlet API are different APIs, and
> in view of r1429173 which fixed a similar issue with cache in
> SecurityUtil.

I would be surprised to have PreDestroy called if destroy wasn't
ultimately going to be called (or at least the goal is to call destroy
-- perhaps some error prevents us from doing so). I guess that means
that I would personally favor the current implementation. On the other
hand, I don't use these features so I don't have a vested interest (yet)
in how they operate. I'm just commenting based upon basic logic.

-chris

Attachment: signature.asc
Description: OpenPGP digital signature

Reply via email to