users@ejb-spec.java.net

[ejb-spec users] [jsr345-experts] Re: PassivationTimeout (was: [JIRA] Commented: (EJB_SPEC-56) Preventing Passivation of SFSBs)

From: Linda DeMichiel <linda.demichiel_at_oracle.com>
Date: Tue, 08 May 2012 16:25:30 -0700

The timeout itself strikes me as more a tuning parameter that is more
appropriate to a product configuration than as something that
we should be standardizing on.

If destroying the instance is preferable to passivating it, that
can be achieved by throwing an exception from the PrePassivate method.

Otherwise, this seems to provide advice to the container that in
deciding how to manage resources, passivation of the given bean type
should come low on the list. If it is important to specify
that, then I guess I'd prefer to see a DoNotPassivate metadata
annotation/element rather than a timeout value.

What requests for a timeout value per se have we otherwise seen?

On 5/8/2012 3:07 PM, Marina Vatkina wrote:
> Experts,
>
> Please vote
>
> A) if you agree to add the @PassivationTimeout to the EJB3.2
> B) if you don't think it is necessary
>
> thanks,
> -marina
>
> -------- Original Message --------
> Subject: [ejb-spec issues] [JIRA] Commented: (EJB_SPEC-56) Preventing Passivation of SFSBs
> Date: Tue, 8 May 2012 21:30:20 +0000 (GMT+00:00)
> From: Carlo de Wolf (JIRA) <jira-no-reply_at_java.net>
> Reply-To: issues_at_ejb-spec.java.net
> To: issues_at_ejb-spec.java.net
>
>
>
> [
> http://java.net/jira/browse/EJB_SPEC-56?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=339309#action_339309
> ]
> Carlo de Wolf commented on EJB_SPEC-56:
> ---------------------------------------
>
> http://docs.oracle.com/javaee/6/api/javax/ejb/StatefulTimeout.html#value%28%29
>
> A value of -1 means the bean will never be passivated due to timeout.
>
>> Preventing Passivation of SFSBs
>> -------------------------------
>>
>> Key: EJB_SPEC-56
>> URL: http://java.net/jira/browse/EJB_SPEC-56
>> Project: ejb-spec
>> Issue Type: New Feature
>> Affects Versions: 3.2
>> Reporter: abien
>>
>> Stateful Session Beans can be passivated (and so often serialized) by the container to disk to save resources. This
>> behavior can lead to problems with performance, scalability and even robustness of the application. A SFSB may contain
>> non-serializable attributes which prevent a successful serialization and lead to runtime exceptions.
>> Proposal: introduction of @NotPassivable annotation (TODO: suggest better name) to prevent passivation of SFSB. SFSB
>> denoted with this annotation should never be passivated and the methods ejbActivate and ejbPassivate never invoked. In
>> an overload scenario the container is supposed to destroy the SFSB instances, instead of passivating them.
>> @Documented
>> @Target({ElementType.METHOD, ElementType.TYPE})
>> @Retention(RetentionPolicy.RUNTIME)
>> public @interface NotPassivable {
>> }
>