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 Groups) – ripper234