持久性错误
我有一堂课:
@PersistenceCapable
public class X{
@Persistent
@Order(extensions = @Extension(vendorName = "datanucleus", key = "list-ordering", value = "date desc"))
private List<Race> list;
@Persistent
private Float value;
}
当我尝试制作时:
PersistenceManager pm = PMF.get().getPersistenceManager();
try {
X x = pm.getObjectById(X.class, id);
x.setValue(listObject.getValue().floatValue());
x.getList().add(listObject);
} finally {
pm.close();
}
我期望在我的 X 对象中添加一个 listValue 并设置“value”的值。但结果只是将列表中的值相加,忽略了ghe值的设置!
有什么问题吗?
I have a class:
@PersistenceCapable
public class X{
@Persistent
@Order(extensions = @Extension(vendorName = "datanucleus", key = "list-ordering", value = "date desc"))
private List<Race> list;
@Persistent
private Float value;
}
When I try to make:
PersistenceManager pm = PMF.get().getPersistenceManager();
try {
X x = pm.getObjectById(X.class, id);
x.setValue(listObject.getValue().floatValue());
x.getList().add(listObject);
} finally {
pm.close();
}
I'm expecting that in my X object I will add a listValue and set the value of 'value'. But the result is only adding the value in the list, ignoring the setting of ghe value!
Is there anything wrong?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
这是一个并发错误。
从更改同一对象的另一段代码调用此方法。所以这个调用的变化将会被忽略。
It was a concurrency error.
This method is called from another piece of code that changes the same object. So the changes of this call will be ignored.