2013-02-04 38 views

回答

7

上的代碼牧場asnwer是正確的,你必須使用SessionContext

@Resource 
private SessionContext ctx; 

//and then in method 
if(fail) { 
    ctx.setRollBackOnly(); 
} 

也是這個article見。