Play! framework immediate save?

前端 未结 3 1031
生来不讨喜
生来不讨喜 2021-02-20 02:27

In Play! if you call this:

void method()
{
User u = User();
u.name = \"bob\";
u.save();
while(true){/* endless loop */}
}

Nothing will actually

3条回答
  •  情书的邮戳
    2021-02-20 03:06

    Try

    User.em().flush();
    

    If I'm not mistaken, the default Play! model holds a refference to the EntityManager which can be accessed like that.

提交回复
热议问题