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

SmokingAPipe do-not-reply at jboss.com
Sun Dec 10 14:31:42 EST 2006


Ok, more info:

From: http://docs.jboss.com/seam/latest/reference/en/html/configuration.html section 9.4:

anonymous wrote : Hibernate users developed the open session in view pattern to work around this problem (managing DB connections). This pattern is usually implemented as a transaction which spans the entire request.

That's exactly the PHP solution.

anonymous wrote :  There are several problems with this idea, the most serious being that we can't be sure that a transaction has been successful until we commit it, but by the time we commit the transaction, we have already rendered the view.

Which is a serious problem and makes web apps look like crap because it will display "your credit card has been charged" on the top of the page and then a "database transaction failed" message below that, leaving the user thinking, "this site is a joke."

anonymous wrote :  Furthermore, this is at best a partial solution to the problem, because we can still meet the dreaded LazyInitializationException if we try to re-use the entity object in the next request.

Which is the most serious problem.  PHP solves it by not having any objects which survive beyond a single request, meaning that their apps will never scale without hacks to solve that problem.  PHP hacks are either clusters with object caching hacks, or cumbersome database clusters to take out the problem of database scalability.  Java wins by having real objects able to stay in memory on the server between requests, but that creates the problem of detached objects, which it sounds like Seam solves with its conversation context and SMPC, which is what I need to get working.


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

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



More information about the jboss-user mailing list