[JBoss JIRA] (CDI-708) Serialization problems in section "1.3.1. JSF example".

classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view
Report Content as Inappropriate

[JBoss JIRA] (CDI-708) Serialization problems in section "1.3.1. JSF example".

JIRA issues@jboss.org

    [ https://issues.jboss.org/browse/CDI-708?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13421502#comment-13421502 ]

Martin Kouba commented on CDI-708:

Good catch! For the record, this also applies to {{CriteriaQuery<User> query}} field and  the resource bean for {{EntityManager}} is defined in 1.3.3 as {{@Dependent}}:
 @Produces @PersistenceContext(unitName="UserData")
 @Users EntityManager userDatabaseEntityManager;
(in fact, containers are not required to support resources with scope other than {{@Dependent}})

> Serialization problems in section "1.3.1. JSF example".
> -------------------------------------------------------
>                 Key: CDI-708
>                 URL: https://issues.jboss.org/browse/CDI-708
>             Project: CDI Specification Issues
>          Issue Type: Bug
>          Components: Concepts
>    Affects Versions: 2.0 .Final
>            Reporter: Martin Andersson
> Section "1.3.1. JSF example" provide an example of a class {{Login}}, that saves in its state an {{EntityManager}} reference and two {{Parameter}} references.
> The JPA specification does not say that a {{Parameter}} instance is serializable.
> This is also true for the {{EntityManager}} reference which is {{@Dependent}} (see section "1.3.3. Java EE component environment example"). JPA does not specify that the {{EntityManager}} is serializable and the EJB specification only specifies serialization semantics for passivation-enabled {{@Stateful}} EJB:s (which encourages the bean provider to not mark an {{EntityManager}} reference as transient, see EJB ยง4.2.1).

This message was sent by Atlassian JIRA

cdi-dev mailing list
[hidden email]

Note that for all code provided on this list, the provider licenses the code under the Apache License, Version 2 (http://www.apache.org/licenses/LICENSE-2.0.html). For all other ideas provided on this list, the provider waives all patent and other intellectual property rights inherent in such information.