[jboss-user] [JBoss Seam] - Re: Transaction Demarcation

toni do-not-reply at jboss.com
Fri May 4 07:47:47 EDT 2007


Well thank you for clarifying this! I was already wondering why seam would introduce an extra transaction annotation, which lacks some of the EJB3 transactional attributes.

anonymous wrote : 
  | By the way, you can always use the TransactionalSeamPhaseListener and @TransactionAttribute(REQUIRES_NEW) to suspend the existing transaction during a particular method call in INVOKE APPLICATION. Your method then executes in a new transaction context - which is committed when the method returns.
  | 
  | As long as your are using a Seam-managed persistence context with at In EntityManager, this should work fine even if your method calls other transactional methods that use the entity manager.
  | 

However, I still have to say that tagging my method with @TransactionAttribute(REQUIRES_NEW) and using a "TransactionalSeamPhaseListener" does not work: All the data is written at the very end of the invocation, which takes about 20 minutes.

Do you have any idea why your suggestion does/might not work in my szenario, which is:

User klicks a link, which calls an action method of a SFSB (statefull), which then calls a SLSB (stateless), which start inserting many entities by repeately calling local methods of which some again call another SLSB's method.


BTW: In another forum thread somebody told me to use @TransactionTimeout, when I ran into a TransactionTimeout exception, which occurred because the process lasts for 20 minutes. I tried that without any luck.

I had to increase the Timeout in jta-service.xml in order for this single transaction to complete at all. Because the suggested annotation did not extend the Timeout and because your suggestions does not work for me either, I get the feeling that those EJB3 annotations are not working with/on seam components.

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

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



More information about the jboss-user mailing list