Not possible to use server after db = server.use?

24 views
Skip to first unread message

Eric24

unread,
Oct 3, 2017, 8:46:23 AM10/3/17
to orient-...@googlegroups.com
Can anyone answer this question?
https://stackoverflow.com/questions/46536616/not-possible-to-use-server-after-db-server-use

PS - I'm not sure what the comment about opening a github request is all about--I'm asking a question, not requesting a feature.


Here's the referenced code:

"use strict";


const util = require('util');
const OrientDB = require('orientjs');


console
.log('opening server');
var server = OrientDB({
  host
: '172.30.1.15',
  port
: 2424,
  username
: 'root',
  password
: '***'
});


console
.log('opening db');
var db = server.use({
  name
: 'GratefulDeadConcerts',
  username
: 'admin',
  password
: 'admin'
});
console
.log('using database: ' + db.name);


// this fails (hangs forever) if the server.use above is included, but works if it's commented out
console
.log('server.list');
server
.list()
.then(function(dbs) {
  console
.log(`Database count: ${dbs.length}`);
  console
.log(util.inspect(dbs));
}).error(function(error) {

  console
.log('Error: ' + error);
}).catch(function(error) {

  console
.log('Exception: ' + error);
});



// application shutdown handler
process
.on('SIGINT', function () {
  console
.log('SIGINT');

  console
.log('closing db');
  db
.close()
 
.then(function() {
    console
.log('closing server');
    server
.close();
    console
.log('exiting');
    process
.exit(0);
 
});
});



Enrico Risa

unread,
Oct 3, 2017, 10:57:25 AM10/3/17
to orient-...@googlegroups.com
Hi Eric

let me check on this

2017-10-03 14:46 GMT+02:00 Eric24 <er...@24x8.com>:
Can anyone answer this question?
https://stackoverflow.com/questions/46536616/not-possible-to-use-server-after-db-server-use

PS - I'm not sure what the comment about opening a github request is all about--I'm asking a question, not requesting a feature.


Here's the referenced code:

"use strict";


const util = require('util');
const OrientDB = require('orientjs');


console
.log('opening server');
var server = OrientDB({
  host
: '172.30.1.15',
  port
: 2424,
  username
: 'root',

  password
: 'ecdl3235'


--

---
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+unsubscribe@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Enrico Risa

unread,
Oct 4, 2017, 4:17:23 AM10/4/17
to orient-...@googlegroups.com
Hi Eric

Seems a bug on session management, i've created an issue here

https://github.com/orientechnologies/orientjs/issues/279

Eric24

unread,
Oct 4, 2017, 8:24:12 AM10/4/17
to orient-...@googlegroups.com
Thanks! Well, at least I'm not crazy! (I feel certain I've been able to do it in the past, but I can't say for certain what versions of orientjs and OrientDB I was using the last time I tried).

What about the Promise timeout in general? If a call to an orientjs function fails for any reason, I would never expect the result to be for it to "hang" (that's why I have both .error and .catch in my example--I don't think both should be necessary, but neither were working). How should it work?


On Wednesday, October 4, 2017 at 3:17:23 AM UTC-5, Enrico Risa wrote:
Hi Eric

Seems a bug on session management, i've created an issue here

https://github.com/orientechnologies/orientjs/issues/279
2017-10-03 16:56 GMT+02:00 Enrico Risa <enric...@gmail.com>:
Hi Eric

let me check on this
2017-10-03 14:46 GMT+02:00 Eric24 <er...@24x8.com>:
Can anyone answer this question?
https://stackoverflow.com/questions/46536616/not-possible-to-use-server-after-db-server-use

PS - I'm not sure what the comment about opening a github request is all about--I'm asking a question, not requesting a feature.


Here's the referenced code:

"use strict";


const util = require('util');
const OrientDB = require('orientjs');


console
.log('opening server');
var server = OrientDB({
  host
: '172.30.1.15',
  port
: 2424,
  username
: 'root',

  password
: '***'
To unsubscribe from this group and stop receiving emails from it, send an email to orient-databa...@googlegroups.com.

Enrico Risa

unread,
Oct 4, 2017, 9:14:20 AM10/4/17
to orient-...@googlegroups.com
Hi Eric

There is no timeout now on Promise. Error are raised if the server respond with an error code.
In this case there was no error from the server. The request was blocked on reading bytes (caused by a bad request).



2017-10-04 14:24 GMT+02:00 Eric24 <er...@24x8.com>:
Thanks! Well, at least I'm not crazy! (I feel certain I've been able to do it in the past, but I can't say for certain what versions of orientjs and OrientDB I was using the last time I tried).

What about the Promise timeout in general? If a call to an orientjs function fails for any reason, I would never expect the result to be for it to "hang" (that's why I have both .error and .catch in my example--I don't think both should be necessary, but neither were working). How should it work?


On Wednesday, October 4, 2017 at 3:17:23 AM UTC-5, Enrico Risa wrote:
Hi Eric

Seems a bug on session management, i've created an issue here

https://github.com/orientechnologies/orientjs/issues/279
2017-10-03 16:56 GMT+02:00 Enrico Risa <enric...@gmail.com>:
Hi Eric

let me check on this
2017-10-03 14:46 GMT+02:00 Eric24 <er...@24x8.com>:
Can anyone answer this question?
https://stackoverflow.com/questions/46536616/not-possible-to-use-server-after-db-server-use

PS - I'm not sure what the comment about opening a github request is all about--I'm asking a question, not requesting a feature.


Here's the referenced code:

"use strict";


const util = require('util');
const OrientDB = require('orientjs');


console
.log('opening server');
var server = OrientDB({
  host
: '172.30.1.15',
  port
: 2424,
  username
: 'root',

  password
: 'ecdl3235'
To unsubscribe from this group and stop receiving emails from it, send an email to orient-database+unsubscribe@googlegroups.com.
Reply all
Reply to author
Forward
0 new messages