-
1. Re: Why @ViewScope and Seam Managed Persistence Context doesn't work?
zeeman Mar 12, 2012 11:01 AM (in response to rafaelmeireles)I have the same exact problem that has been driving me crazy. Any ideas?
Also, Seam managed EM on a stateless EJB does not work either. I get get conversation context is inactive. I tried with OP listed above to produce an EM with a different scope but it still does not work. What are we missing?
-
2. Re: Why @ViewScope and Seam Managed Persistence Context doesn't work?
rafaelmeireles Mar 12, 2012 1:26 PM (in response to zeeman)The seam 3 apparently does not work fine with ViewScope. I was disappointed with seam 3. Known issues are still unresolved.
-
3. Re: Why @ViewScope and Seam Managed Persistence Context doesn't work?
rafaelmeireles Mar 20, 2012 10:44 PM (in response to rafaelmeireles)zeeman, do you solved this problem? Anybody can help?
-
4. Re: Why @ViewScope and Seam Managed Persistence Context doesn't work?
zeeman Mar 20, 2012 10:56 PM (in response to rafaelmeireles)No solution. I was hoping to find one here.
-
5. Re: Why @ViewScope and Seam Managed Persistence Context doesn't work?
romanow Mar 21, 2012 11:18 AM (in response to zeeman)I saw similar behavior on my pages. It was always JPA issue. Entity is taken from DB, displayed on the page, updated to DB and on second AJAX call entity is not in EM. This is actually a good thing when you think about it.
Your case may be different. Try conversation or session scope to verify my theory.
ViewScope works pretty nice for me.
I experienced some issue with conversation. There are big differences between Seam 2 and Seam 3, you may want to read about it. Also I found that explicit propagation of conversation works better than annotated. In my case that was when I tried to propagate from PostConstruct.
-
6. Re: Why @ViewScope and Seam Managed Persistence Context doesn't work?
rafaelmeireles Mar 21, 2012 7:35 PM (in response to romanow)With conversation it work, but the advantage of ViewScope is that I don't explicit begin or end nothing. Nobody of seam team that can help?
I think in this integration with jsf 2 Spring it is more mature than seam.
-
7. Re: Why @ViewScope and Seam Managed Persistence Context doesn't work?
hantsy Mar 22, 2012 8:13 AM (in response to rafaelmeireles)I encountered some problems before when I used @ViewScoped in the Seam 3.x
So I used ConvesationScoped as posible.
And some other scope, application, request, session, never used @ViewScoped.
-
8. Re: Why @ViewScope and Seam Managed Persistence Context doesn't work?
rafaelmeireles Mar 22, 2012 9:07 AM (in response to hantsy)This problem is in seam-faces module? If I will create an issue to solve the problem.
-
9. Re: Why @ViewScope and Seam Managed Persistence Context doesn't work?
zeeman Mar 22, 2012 1:24 PM (in response to rafaelmeireles)Please keep this thread updated with JIRA issue and solution.
-
10. Re: Why @ViewScope and Seam Managed Persistence Context doesn't work?
rafaelmeireles Mar 25, 2012 9:11 AM (in response to zeeman)This solution works fine for me:
http://www.verborgh.be/articles/2010/01/06/porting-the-viewscoped-jsf-annotation-to-cdi/
any doubt ask me.
-
11. Re: Why @ViewScope and Seam Managed Persistence Context doesn't work?
zeeman Mar 25, 2012 9:14 PM (in response to rafaelmeireles)Rafael,
I don't see how is the solution in provided link for implementing a @Viewscope would help with injecting an EntityManager?
Can you explaing how would that solution help with the problem in OP's thread? Thanks.
-
12. Re: Why @ViewScope and Seam Managed Persistence Context doesn't work?
hantsy Mar 25, 2012 9:28 PM (in response to rafaelmeireles)it is rewritten in CDI instead...
I think all JSF scopes should be mapped to CDI compitable Scopes and will make thing simple.
Have a look at the MyFaces CODI, a subproject of Apache MyFaces.
-
13. Re: Why @ViewScope and Seam Managed Persistence Context doesn't work?
rafaelmeireles Mar 26, 2012 9:00 AM (in response to zeeman)zeeman wrote:
Rafael,
I don't see how is the solution in provided link for implementing a @Viewscope would help with injecting an EntityManager?
Can you explaing how would that solution help with the problem in OP's thread? Thanks.
Follow this article the entity pass to be managed between request, because in this article the author overwrite the annotation @ViewScope so the annotattion can be used like this:
@SuppressWarnings("unused")
@ExtensionManaged
@Produces
@PersistenceUnit
@ViewScope
private EntityManagerFactory entityManagerFactory;