-
1. Re: Seam + EJB on multiple Layers
nicolasc Nov 6, 2008 7:49 AM (in response to nicolasc)Should I reformulate my Question? To much to read? Please Feedback really needed!
-
2. Re: Seam + EJB on multiple Layers
chawax Nov 6, 2008 2:53 PM (in response to nicolasc)Hi,
I made the same kind of design for the project I work on.
All components are EJB, stateful ones for JSF backing beans, stateless ones for services. At first time, as you suggest, I used EJB for services and DAO layer. But I finally made them Seam components because I needed to get current user in some of these services and it was a lot easier if all my components were Seam components ! Is there a reason why you want your service and DAO layer to be designed with EJB session beans and not Seam components ?About @Name annotation, you can use components.xml file to define your Seam components. I needed to do this because I use a MDA generator (AndroMDA) and it works perfect.
Olivier
-
3. Re: Seam + EJB on multiple Layers
gjeudy Nov 6, 2008 3:36 PM (in response to nicolasc)Have you read about SMPC ? If you keep your DAO layer EJB only then I assume you won't be using SMPC but regular JPA PersistenceContext. I advise against doing that as you will have all sorts of bad behavior like LIEs, detached entities etc..
Read more about this in Seam reference doc persistence section.
-
4. Re: Seam + EJB on multiple Layers
eskape.esk.ngs.ru Nov 6, 2008 3:39 PM (in response to nicolasc)Olivier,
It is possible to get current users on EJB tier using EJBContext.getCallerPrincipal(), no need using Seam. We have the same approach - Seam is used as web framework only. The main drawback with Seam is that it is not possible using Seam Stateless Beans using JNDI lookups or with @EJB annotation, and this will not allow our third-party vendors to provide additional
client
(orplugin
EJBs). -
5. Re: Seam + EJB on multiple Layers
chawax Nov 6, 2008 4:05 PM (in response to nicolasc)
egor kolesnikov wrote on Nov 06, 2008 15:39:
It is possible to get current users on EJB tier using EJBContext.getCallerPrincipal(), no need using Seam.Well, I never found how to propagate security from Seam to EJB3 layer. I had posted on this forum : http://seamframework.org/Community/SeamAndSecurityContext and as you will see I spent a lot of time with this, tried many solutions but had no success at the end. Moreover for what I understood security propagation is application server specific, and I absolutely need my web application to work on any AS. For these reasons I think Seam was the better solution for me ;)