내 자바 EE 6 응용 프로그램에서 관리되는 콩이 : 지금까지 내가 @TransactionAttribute을 이해트랜잭션 @TransactionAttribute (TransactionAttributeType.REQUIRES_NEW)을 사용하는 경우에도 자동으로 만들어지지
@Named
@RequestScoped
@TransactionAttribute(TransactionAttributeType.REQUIRES_NEW)
public class RegistrationBean implements Serializable {
@PersistenceContext
EntityManager em;
public String doRegistration() {
MyEntity entity = new MyEntity();
em.persist(entity);
return "view";
}
}
, 새로운 트랜잭션이 자동으로되어야한다 만들어진. 하지만 예외가 발생하기 때문에 분명히 그렇지 않습니다. javax.persistence.TransactionRequiredException: EntityManager must be access within a transaction
내 영속 유닛의 속성은 transaction-type="JTA"
입니다. 저는 JBoss 6 cr1을 사용하고 있습니다.