[jboss-user] [JBoss Seam] - Seam and ejb3.0 transactions question?

Stateless Bean do-not-reply at jboss.com
Wed Nov 28 12:05:36 EST 2007


Hi,
I got simple method with annotation:


  | 	@TransactionAttribute(TransactionAttributeType.REQUIRED)
  | 	public String saveOrder() {
  |     	try {
  | //block A
  | ...
  | //Block B
  | 		}
  | 		catch (Exception e) {}
  | 		return "error";
  | 	}
  | 


and my em is managed by container


  | 	@In
  | 	protected EntityManager em;	
  | 
  |     <persistence:managed-persistence-context name="em" auto-create="true"
  |                 persistence-unit-jndi-name="java:/mlmEntityManagerFactory"/>
  | 

block A load some entities and calc somethink,
in block B i force method to get error.
In this case when I get error there should be whole transaction rolled back, but all changed are saved? Why and how can I roll back when I get some/any error?

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

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



More information about the jboss-user mailing list