Manually control transactions in Seam
https://access.redhat.com/kb/docs/DOC-52955 How do I manually control transactions in Seam? Article ID: 52955 - Created on: Aug 18, 2009 3:53 PM - Last Modified: Mar 28, 2011 11:32 AM Issue A more fine grained approach is sometimes desired when coding for certain situations. For example one might want to begin/comit multiple transactions in the same method instead of breaking those transactions out to new methods with REQUIRES_NEW. Environment JBoss Seam 2.x Resolution By default manual control of a Transaction works out of the box in Seam. To accomplish this one must suspend the transaction on the method where the control is required. With Seam Managed Transactions there will be a transaction active which the method will participate, so the goal is for a specific method not to partipate in the Tx. To do this in an EJB3 add the following annotation to the desired method @TransactionAttribute(TransactionAttributeType.NOT_SUPPORTED) Adding this Annotation is not necessary in a Seam pojo component. From this point one can use import org.jboss.seam.transaction.Transaction; ... try { Transaction.instance().begin(); //Some unit of work Transaction.instance().commit(); } catch(Exception ex) { try { Transaction.instance().rollBack(); } catch(Exception rbEx) { //log exception } } Note that Multiple Transactions can be begun and committed in the same method when doing this.