[jboss-user] [JBoss Seam] - Re: How many EntityManagers and SFSBs in a web app?

SmokingAPipe do-not-reply at jboss.com
Thu Dec 7 13:38:54 EST 2006


To put it another way, when the View needs to render something, it is very likely that the objects in the View will need access to an EntityManager.  Hibernate had no solution for this; the best you could do would be to use a Filter to handle the EntityManager, but that is really not ideal because it's ugly and in some cases the Filter doesn't get to complete its task.  So that's bad.  I switched to Seam because I thought that Seam finally solved the "EntityManager in the View phase" problem, but apparently it does not.

Why is this so hard?  Come on, even PHP has a solution to this.  In PHP at the beginning of your request, you get a DB connection, and then everywhere else in the request you just do mysql_query(...), and it all works, and at the end of the request, the DB connection is freed.  Why is Java having such a hard time doing that?  I notice that I can access the FacesMessages from any object and the FacesMessages is retrieved from the Thread itself.  Why can't an EntityManager run the same way?

Am I the only one who can see that this is a fundamental oversight in the entire Java ORM Web landscape?


View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=3992033#3992033

Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=3992033



More information about the jboss-user mailing list