[seam-issues] [JBoss JIRA] Commented: (SEAMPERSIST-65) Support ViewScoped for Seam Managed Persistence Context

Stuart Douglas (JIRA) jira-events at lists.jboss.org
Thu Aug 18 20:52:17 EDT 2011


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

Stuart Douglas commented on SEAMPERSIST-65:
-------------------------------------------

Alternatively you could use seam-xml to add the ViewScoped annotation to the class, as it ignores @Target. 

> Support ViewScoped for Seam Managed Persistence Context
> -------------------------------------------------------
>
>                 Key: SEAMPERSIST-65
>                 URL: https://issues.jboss.org/browse/SEAMPERSIST-65
>             Project: Seam Persistence
>          Issue Type: Feature Request
>    Affects Versions: 3.0.0.Final
>         Environment: JBoss AS7
>            Reporter: Andrew Wheeler
>              Labels: ViewScoped
>
> It would be nice to extend the SMPC to the view scope. When using ajax frameworks view scoped pages often have many action requests. On each invocation the bean state must be resynchronised with the persistence context using merge. This is a little unpleasant as:
> * It can lead to lots of checks to see if an entity is attached and if not to re-attach it.
> * This sometimes can cause the entity manager to flush, thus persisting merged entities pre-maturly.
> Currently it is not possible to do the following as the ViewScoped annotation is not permitted in this context:
> @ExtensionManaged
> @Produces 
> @PersistenceUnit
> @ViewScoped
> EntityManagerFactory viewScopedScoped;	
> Secondly, even if you could then it would probably stop conversation scoped pages from working. Perhaps the scope qualifier could be wrapped using an annotation like @PersistenceScope(ViewScoped.class). It would probably also require producing two entity managers and choosing the right one to inject on the bean using the qualifier. E.g:
> @Produces
> @PersistenceScope(ViewScoped.class)
> EntityManager viewScoped;
> @Produces
> @PersistenceScope(ConversationScoped.class)
> EntityManager conversationScoped;

--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira

        


More information about the seam-issues mailing list