jsr345-experts@ejb-spec.java.net

[jsr345-experts] Re: Order of _at_PreDestroy method calls?

From: Antonio Goncalves <antonio.goncalves_at_gmail.com>
Date: Mon, 12 Sep 2011 10:03:52 +0200

I can't recall talking about this topic in the EJB 3.1 expert group, but it
does seem logical to invoke @PreDestroy in reverse order.

Antonio

On Sat, Sep 10, 2011 at 01:28, Marina Vatkina <marina.vatkina_at_oracle.com>wrote:

> Thank you everybody who replied. I forwarded your thoughts to Bill and
> Linda to look at the issue in connection with other ordering options (like
> JPA lifecycle callback methods).
>
> If anybody else has an opinion on this issue, feel free to add it to the
> thread.
>
> Best,
> -marina
>
>
> Marina Vatkina wrote:
>
>> Dear Experts,
>>
>> (Back from vacation and catching up)
>>
>> So far I got two (unfortunately) opposite replies. Let's try one more
>> time... May be some of you who was on the EG that discussed the original
>> proposal, have any recollection (or any saved emails) of what and why had
>> been decided?
>>
>> thanks,
>> -marina
>>
>> Marina Vatkina wrote:
>>
>>> Bill Shannon asked me to get the EJB EG opinion on this subject. Had this
>>> been discussed in 3.1 EG?
>>>
>>> thanks,
>>> -marina
>>>
>>>
>>> On 5/16/2011 2:05 PM, Bill Shannon wrote:
>>>
>>>> Section EE.5.2.5 of the EE 6 platform spec (page 70) says that both
>>>> @PostConstruct and @PreDestroy methods are called in class hierarchy
>>>> order, with superclass methods called before subclass methods. This
>>>> makes sense for @PostConstruct, but for @PreDestroy it seems like it
>>>> would make more sense to call them in reverse order, so that the
>>>> subclass would be done using any resources of the superclass before
>>>> the superclass freed them.
>>>>
>>>> Can anyone think of any reason that @PreDestroy should be called in
>>>> the same order as @PostConstruct?
>>>>
>>>> If we decided the currently specified behavior is wrong, I'm worried
>>>> about the compatibility impact of changing it. What do *you* think
>>>> the compatibility impact would be? How many programs would break?
>>>>
>>>


-- 
Antonio Goncalves
Software architect and Java Champion
Web site <http://www.antoniogoncalves.org> |
Twitter<http://twitter.com/agoncal>|
Blog <http://feeds.feedburner.com/AntonioGoncalves> |
LinkedIn<http://www.linkedin.com/in/agoncal>| Paris
JUG <http://www.parisjug.org>