简体   繁体   English

VisualVM / OQL如何通过Long ID获得结果?

[英]VisualVM/OQL How to get result by Long id?

Lately we had a crash on production due to lack of memory. 最近,由于内存不足,我们的生产崩溃了。 We were given heap dump which gave my team the answer to what went wrong, but still we've experienced some nondeterministic behaviour from OQL query execution. 我们得到了堆转储,这使我的团队可以解决问题,但我们仍然从OQL查询执行中遇到了一些不确定的行为。

In VisualVM with OQL I tried to get all objects with the same id (which happens to be Long) and as result I get objects with other ids as well. 在带有OQL的VisualVM中,我尝试获取具有相同ID(恰好是Long)的所有对象,结果我也获得了具有其他ID的对象。

select m from com.someapp.service.model.SomeModel m where m.id.value = 1;

This query always returns more than 100 results with seemingly random id values. 此查询总是返回100多个看似随机的id值的结果。

Why is that? 这是为什么? How to write a query that will return the instance that I'm looking for? 如何编写查询以返回我要查找的实例?

There is a bug in OQL. OQL中有一个错误。 The problem is field name 'id'. 问题是字段名称“ id”。 Other field names work fine. 其他字段名称也可以正常工作。

See Retrieve "id" field values via VisualVM OQL query for workaround. 请参阅通过VisualVM OQL查询检索“ id”字段值以获取解决方法。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM