[jboss-user] [JBoss Seam] - Transaction Handling in Seam + Spring

dapeng do-not-reply at jboss.com
Thu Aug 9 11:27:08 EDT 2007


Hi, 

for a new application, I plan to use use a layered architecture based one seam + spring + hibernate. Because of some SOA requirements I choose such a layered architecture, so that spring service beans can be used to serve user interface and service interface requests.

I am now not sure about the best strategy to handle the transaction in this architecture. Until now, I use Spring AOP with @Transactional annotation to mark the transaction boundary. As far as I understand, this has the shortcoming of LayzInitializationException in JSF render response phase. Seam's solution is the TransactionalSeamPhaseListener, which starts 2 separate txs, one spanning update model and invoke application and one spanning render response. I have the following questions:
1. In case of redirect, the second tx will then span the new http request, which contains only the render response phase?
2. If the tx is already started by the PhaseListener, why does the spring example of Seam 2.0 still contains @Transactional annotation in spring beans? Is that only good for invocation outside of Seam, like WS?
3. Is that a good strategy to have both the PhaseListener and @Transactional annotation activated, so that one can handle JSF requests for GUI and the other can handle web service requests?

Any feedback is appreciated.

Dapeng


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

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



More information about the jboss-user mailing list