0
我有一個EJB Stateless Session Bean的,像這樣:EJB JTA空指針異常不回滾
public void persist(Customer customer,Child child){
try{
em.persist(customer);
Father father = new Father();
father.setChild(child); here child is null
em.persist(father);
}catch(Exception e){
}
}
當異常(NullPointerException異常)出現交易不回滾和客戶實體堅持着,但是當我趕上與
public void persist(Customer customer,Child child){
try{
em.persist(customer);
Father father = new Father();
father.setChild(child); here child is null
em.persist(father);
}catch(EJBException e){
}
}
的事務回滾異常,但我不明白爲什麼,NullPointerException異常延伸RuntimeException.The文檔說一個RuntimeException導致回滾。