OIndex occasionally comes back null

#1

Greetings, we have a script which imports a large amount of data into OrientDB. Several of the step use the java API to access indices. We have an ODatabaseDocument instance db and we do the following:

OIndex<?> index = db.getMetadata().getIndexManager().getIndex(“MyIndex”);

This is happening deep down in a loop. During one of the loop iterations, index is randomly coming back as null. This very same index was used several times over in prior iterations of the loop. So we know the index is there, and that there is not a typo or issue with the schema.

After the error logging into the UI we can still issue a Query like:

SELECT FROM INDEX:MyIndex WHERE key = "some-key";

And it will complete just fine. To me this indicates that the index was, and still is, in the database. Is there any reason why the index would randomly come back null?

I should note that we are using a pooled database connection.

Thanks!

#2

I should note, that if this is actually an issue, I can create an issue with more details on GitHub. I am more just wondering if there is a valid reason why the index might come back null, before I go down a rabbit whole!

#3

Hi,
what version are you using?

Thanks
Regards,
Michela

#4

Presently using 3.0.17. There was a related github issue. At the moment, when it comes back null, I simply refresh the db meta data and then try again. Magicallly then the index comes back. So I have a workaround, but this is less than ideal.