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

Andrew Wheeler (JIRA) jira-events at lists.jboss.org
Mon Aug 15 02:11:02 EDT 2011


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


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