Discussion:
[orientdb] lost session NodeJS to OrientDB Server. missing session and token - OTokenSecurityException
Pino Becker
2018-08-24 16:52:38 UTC
Permalink
I'm using OrientDB 3.0.4 community edition with orientjs ("orientjs":
"^3.0.0-beta.0",) with NodeJS (v8.11.3) and express ("express": "^4.16.3",)
and I'm losing the session sometimes as early as ~10 minutes, sometimes the
session persists longer. I wrote a script which "tickles" the server,
performing a query every 15 minutes. So the client is performing tasks on
the server and there should not be a session timeout.

Nodejs and express reside on different machines than the OrientDB server.

here is the server response after the session times out:

com.orientechnologies.orient.enterprise.channel.binary.OTokenSecurityException

{ name: 'OrientDB.RequestError',
message: 'missing session and token',
data: {},
previous: [],
code: 5,
identifier: 0,
id: 1,
type:
'com.orientechnologies.orient.enterprise.channel.binary.OTokenSecurityException',
hasMore: 0 }

I tried with several new project setups and different databases with the
same result.
From what I can find online this problem is known, but the information I
found usually pertains to Java, and not javascript.

Does anybody have experience in developing solutions with OrientDB and
NodeJS and is familiar with this problem?
The documentation on the OrientDB website for 3.0.x is incomplete, some of
the links throw 404s. BTW I tried following the introduction to OrientDB
videos on Udemy verbatim to get started with OrientDB but the code
demonstrated does not work with the 3.0.x version. That might be
discouraging to new users trying out OrientDB. Any links with related info
especially for server functions in 3.0.X and when there will be updated
documentation available as well as samples would also be great!
.
Any help is much appreciated!
--
---
You received this message because you are subscribed to the Google Groups "OrientDB" group.
To unsubscribe from this group and stop receiving emails from it, send an email to orient-database+***@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
Jovica Aleksic
2018-08-25 07:21:12 UTC
Permalink
I'm using nodejs and express with orientjs too, but I do not manage user
sessions with orientdb.
Instead, I use passport.js with its local strategy, together with
express-session, connect-redis and redis.
So, while I keep users in OrientDB, I keep sessions completely in redis,
and it works nicely with passport and exporess-session.

Not sure how helpful it is, as I just took out a couple of files from my
app (which I can't publish unfortunately), and I removed some extra stuff,
but you might get the idea from this
gist: https://gist.github.com/loopmode/d9c0329b05f991a8d9e714cf18c27476
Post by Pino Becker
"^3.0.0-beta.0",) with NodeJS (v8.11.3) and express ("express": "^4.16.3",)
and I'm losing the session sometimes as early as ~10 minutes, sometimes the
session persists longer. I wrote a script which "tickles" the server,
performing a query every 15 minutes. So the client is performing tasks on
the server and there should not be a session timeout.
Nodejs and express reside on different machines than the OrientDB server.
com.orientechnologies.orient.enterprise.channel.binary.OTokenSecurityException
{ name: 'OrientDB.RequestError',
message: 'missing session and token',
data: {},
previous: [],
code: 5,
identifier: 0,
id: 1,
'com.orientechnologies.orient.enterprise.channel.binary.OTokenSecurityException',
hasMore: 0 }
I tried with several new project setups and different databases with the
same result.
From what I can find online this problem is known, but the information I
found usually pertains to Java, and not javascript.
Does anybody have experience in developing solutions with OrientDB and
NodeJS and is familiar with this problem?
The documentation on the OrientDB website for 3.0.x is incomplete, some of
the links throw 404s. BTW I tried following the introduction to OrientDB
videos on Udemy verbatim to get started with OrientDB but the code
demonstrated does not work with the 3.0.x version. That might be
discouraging to new users trying out OrientDB. Any links with related info
especially for server functions in 3.0.X and when there will be updated
documentation available as well as samples would also be great!
.
Any help is much appreciated!
--
---
You received this message because you are subscribed to the Google Groups "OrientDB" group.
To unsubscribe from this group and stop receiving emails from it, send an email to orient-database+***@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
Loading...