0
how to manually commit a Play! JPA transaction을 발견 한 후 ... 정말 필요가 있는지 확신 할 수 없습니다.이 재생을 수동으로 실행해야합니까? 트랜잭션?
저는 컨트롤러 액션이 두 개 있습니다. 하나는 웹 사이트를 추가하고 바로 다음 페이지로 리디렉션됩니다 ... 그 편집 폼을 보여줍니다.
public static void added(String title){
Task task= new Task();
website.title = title;
task.save();
// Do I really need to commit this transaction here?
// Note that task.id is already filled here, somehow
// https://stackoverflow.com/questions/8169640/how-does-an-entity-get-an-id-before-a-transaction-is-committed-in-jpa-play
JPA.em().getTransaction().commit();
edit(task.id);
}
public static void edit(long taskId) {
Task task = Task.find("byId", taskId).first();
render(task);
}
edit()
로 리디렉션하기 전에 트랜잭션을 커밋 할 필요가 있는가?
답장을 보내 주셔서 감사합니다. 질문. 공식 포럼 (Google 그룹스 외) – ripper234