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

Andrew Wheeler (JIRA) jira-events at lists.jboss.org
Thu Aug 18 20:44:18 EDT 2011

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

Andrew Wheeler commented on SEAMPERSIST-65:

Yes I tend to agree. In fact, if you look at the javax.enterprise.context package they are all appropriately annotated with field, method and type. Hence I can have producer method annotated with RequestScoped but annoyingly, not with ViewScoped.

If this is implemented from the spec then I wouldn't hold my breath trying to get this changed anytime soon!

> 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