Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » EMF » [CDO] NPE in AbstractQueryIterator.close(AbstractQueryIterator.java:88)
[CDO] NPE in AbstractQueryIterator.close(AbstractQueryIterator.java:88) [message #1850111] Wed, 16 February 2022 13:43 Go to next message
Linuxhippy Mising name is currently offline Linuxhippy Mising nameFriend
Messages: 71
Registered: July 2009
Member
Hi,

We have a few places where we create a CDOQuery in the UIThread and pass it to some background threads where the actual query is performed (getResult() is called).

However, from time to time (rather seldom) we see Exceptions which should not be possible, like:

Exception in thread "Thread-548" java.lang.NullPointerException
at org.eclipse.emf.spi.cdo.AbstractQueryIterator.close(AbstractQueryIterator.java:88)
at org.eclipse.emf.internal.cdo.query.CDOQueryImpl.getResult(CDOQueryImpl.java:108)
at org.eclipse.emf.internal.cdo.query.CDOQueryImpl.getResult(CDOQueryImpl.java:116)

Therefore I wonder, is this use valid?

Thanks and best regards, Clemens

Some code to illustrate the issue:
CDOQuery query = cdoView.createQuery(SQLQueryHandler.QUERY_LANGUAGE, sql);
query.setParameter(SQLQueryHandler.CDO_OBJECT_QUERY, false);

new Thread() {
  public void run() {
       query.getResult();
  }
}.start();

[Updated on: Wed, 16 February 2022 13:44]

Report message to a moderator

Re: [CDO] NPE in AbstractQueryIterator.close(AbstractQueryIterator.java:88) [message #1850143 is a reply to message #1850111] Thu, 17 February 2022 18:26 Go to previous messageGo to next message
Eike Stepper is currently offline Eike StepperFriend
Messages: 6682
Registered: July 2009
Senior Member
Hi Clemens,

Generally I see nothing bad in performing the query in a background thread.

The only way for the session protocol to become null is that the session is closed. Is it possible that some other thread closes the session of the query's view?


Re: [CDO] NPE in AbstractQueryIterator.close(AbstractQueryIterator.java:88) [message #1850418 is a reply to message #1850143] Wed, 02 March 2022 10:27 Go to previous message
Linuxhippy Mising name is currently offline Linuxhippy Mising nameFriend
Messages: 71
Registered: July 2009
Member
Thanks a lot for the confirmation - good to know the current design can stay as-is, and is supported by CDO. I'll have a look regarding async session closing.
Previous Topic:[CDO] Remote unlocking mechanism changed
Next Topic:Optimizing AuditListTableMappingWithRages.moveUp/Down
Goto Forum:
  


Current Time: Thu May 02 04:28:30 GMT 2024

Powered by FUDForum. Page generated in 0.03413 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top