【发布时间】:2012-02-10 10:23:25
【问题描述】:
我的问题是为什么刷新不起作用:
public void ejbService(){
Customer c = em.find(Customer.class,1);
c.setName("newName");
em.flush();
//at this point when I query mysql table I can not see "newName"
thread.sleep(10000);
c.setName("anotherName");
}
完成方法后,我在数据库中看到“anotherName” 我也用 em.find(Customer.class,1,Lock.None);但还是不行
RGDS
【问题讨论】:
标签: java jpa transactions entitymanager