Ola, eu ser nova aqui e preciso de ajuda Desculpe mas ainda estou estudando Portugues e
iniciei estudar EJB ha um mes… estou aprendendo sobre transactions, mas nao estou entendendo
porque o source abaixo nao funciona! Nao deveria persistir c1 e executar rollback para c ???
Obrigado,
Natasha
@TransactionAttribute(TransactionAttributeTpe.REQUIRED)
public void test1() {
Customer c = new Customer();
c.setNome("Natasha");
em.persist(c);
test2();
throw new RuntimeException();
}
@TransactionAttribute(TransactionAttributeTpe.REQUIRES_NEW)
public void test2() {
Customer c1 = new Customer();
c1.setNome("Irina");
em.persist(c1);
}