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 <[email protected] <javascript:>>:
>
>> Hi Eric
>>
>> let me check on this
>>
>> 2017-10-03 14:46 GMT+02:00 Eric24 <[email protected] <javascript:>>:
>>
>>> 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'
>>> });
>>>
>>>
>>> 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);
>>>   });
>>> });
>>>
>>>
>>>
>>> -- 
>>>
>>> --- 
>>> 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 [email protected] <javascript:>.
>>> For more options, visit https://groups.google.com/d/optout.
>>>
>>
>>
>

-- 

--- 
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 [email protected].
For more options, visit https://groups.google.com/d/optout.

Reply via email to