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

"missing session and token" after a period of time without interacting with OrientDB #8772

Closed
ismaelpernas opened this issue Feb 15, 2019 · 5 comments
Assignees
Labels

Comments

@ismaelpernas
Copy link

OrientDB Version: 3.0.14

Java Version: 1.8

OS: Red Hat Enterprise Linux

Actual behavior

We are getting the following exception consistently when our system is not being used for while and a new request comes in that requires querying OrientDB. Before that all idle time the queries work fine. The exception is:

! com.orientechnologies.orient.enterprise.channel.binary.OTokenSecurityException: missing session and token
! DB name="map"
! DB name="map"
! at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
! at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:62)
! at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)
...

Not sure if this is a bug or I am confused about the java Document API described: here

The current usage of the Document API looks like this:

  1. When our product starts up I create a singleton instance of OrientDB and another of ODatabasePool.
  2. User requests comes in, I build up a query based on the user needs
  3. perform session = odbPool.acquire(); to get a ODatabaseSession
  4. perform session.execute("SQL", command) to get the results
  5. read necessary data from results
  6. perform session.close();
  7. return results

I thought the ODatabasePool was a pool of connections to a database. But looking at the javadoc on ODatabasePool says that it is "A Pool of databases". The documentation also mentions that we should close the database and it goes back to the pool. So I am not sure if I am hitting a bug or misusing the API.

Should I be creating a new ODatabasePool per request instead of having it as a singleton?

My goal is to have the equivalent of the factory.setupPool(10, 30); of the OrientGraphFactory in 2.2.X.

@ismaelpernas
Copy link
Author

@luigidellaquila Any update on this possible issue?

Thanks

@luigidellaquila
Copy link
Member

Hi @ismaelpernas

@wolf4ood is working on it, I'll let you know as soon as it's fixed

Thanks

Luigi

wolf4ood added a commit that referenced this issue Mar 7, 2019
@wolf4ood
Copy link
Member

wolf4ood commented Mar 7, 2019

Hi @ismaelpernas

i've just proposed a fix in this PR,

#8805

Once merged it will solve the issue and it will be available hopefully in 3.0.18

Thanks

@ismaelpernas
Copy link
Author

thanks @wolf4ood !

I'll keep an eye on the 3.0.18 release.

@matanshukry
Copy link
Contributor

Same thing just happened to me now, on 3.0.19, please reopen.
Let me know if you prefer I'll open a new one, although everything is exactly the same.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Development

No branches or pull requests

4 participants