Lately we had a crash in 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.
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.
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.
Why is that? How to write a query that will return the instance that I'm looking for?
There is a bug in OQL. The problem is field name 'id'. Other field names work fine.
See Retrieve "id" field values via VisualVM OQL query for workaround.