Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Unable to get function metadata through java API #5779

Closed
metametametameta opened this issue Feb 25, 2016 · 6 comments
Closed

Unable to get function metadata through java API #5779

metametametameta opened this issue Feb 25, 2016 · 6 comments
Assignees
Milestone

Comments

@metametametameta
Copy link

When acquiring a connection to Orient, function metadata is not populated.

For example:

ODatabaseDocumentTx odbTx = ...
OFunction function = odbTx.getMetadata().getFunctionLibrary().getFunction("functionName");

odbTx.getMetadata().getFunctionLibrary() does not have any functions even though the database has the functions and can be seen through the console or through studio. Even a server restart after function creation does not help, and the function metadata is not populated on connection creation after a server restart.

Note that subsequently calling odbTx.getMetadata().reload() correctly populates the metadata. However, we should not be required to call reload explicitly. The function metadata should be populated when acquiring the connection itself.

Note that the other metadata (indexes, schemas etc.) seem to be populated properly without having to call reload().

I'd also like to make a distinction in the case where the function was created after opening the connection (in which case it makes sense to call reload), but this issue involves opening the connection after the function has already been created.

P.S: Note that the missing function metadata does not prevent us from executing the function in a different way:

odbTx.command(new OCommandFunction("functionName")).execute();

@metametametameta
Copy link
Author

Notes on my environment:

  1. Using 2.2.0 beta

  2. Remote connection created as follows:

OPartitionedDatabasePoolFactory pdf = new OPartitionedDatabasePoolFactory();
ODatabaseDocumentTx db = pdf.get("remote:hostname/dbname", "admin", "admin").acquire();

@tglman
Copy link
Member

tglman commented Feb 29, 2016

Hi @metametametameta,
how do you create the function? from the client itself or from a different client ?

anyway in remote the push of configuration is not yet supported, and you have to call the reload for get the updated configuration, you already found the issue for track it : #3496

@metametametameta
Copy link
Author

I don't think this issue is a result of remote push not being available.

I created the function in the console and even restarted the orient server and all clients after creating the function. So at this point, after restarting the Orient server, and restarting all clients, I would think that odbTx.getMetadata().getFunctionLibrary() should be populated when the remote connection is created from a remote client, but it's not (note that all other metadata is populated).

@tglman
Copy link
Member

tglman commented Mar 8, 2016

hi @metametametameta,

This is quite strange, the client is stateless and when restarted load all the information from scratch from the server, and in the server the information are kept updated all the times, just double check if you are connection to the correct server.

Regards.

@metametametameta
Copy link
Author

As far as I know, I'm connecting properly. Are you not able to reproduce the issue?

It seems that others have had the same issue as well. See the forum post https://groups.google.com/forum/#!searchin/orient-database/function$20metadata/orient-database/SOfycX4xaD8/U7pdH-tSCwAJ

@tglman tglman added this to the 3.0 milestone May 18, 2016
@lvca lvca modified the milestones: 3.0.0, 3.0.x Apr 9, 2018
@tglman
Copy link
Member

tglman commented Apr 17, 2018

Hi,

This was due to the missing of update of the metadata in case of changes with queries, this is fixed with push and network changes in 3.0.0, closing

@tglman tglman closed this as completed Apr 17, 2018
@luigidellaquila luigidellaquila modified the milestones: 3.0.x, 3.0.1 May 18, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

No branches or pull requests

4 participants