Answers for "OrientDB.ConnectionError [10]"

0

OrientDB.ConnectionError [10]

const boostrap = pool => {
  app.use((req, res, next) => {
    pool
      .acquire()
      .then(session => {
        res.locals.db = session;
        res.on('end', () => {
          console.log('end : closing db session...');
          if (session) {
              session.close();
              session = null;
          };
        });
        res.on('close', () => {
          console.log('close : closing db session...');
          if (session) {
              session.close();
              session = null;
          };
        });
        res.on('finish', () => {
          console.log('finish : closing db session...');
          if (session) {
              session.close();
              session = null;
          };
        });
        next();
      })
      .catch(err => {
        console.log('err : closing db session...');
        if (session) {
            session.close();
            session = null;
        };
        res.status(500).send(err);
      });
  });
Posted by: Guest on November-03-2020
0

OrientDB.ConnectionError [10]

const client = new OrientDBClient({
  host: "odbhost",
  db: "userDBName",
  user: "userId",
  password: "userPassword",
  rootUser: "rootId",
  rootPassword: "rootPassword",
  pool: {
    max: 200
  },
  logger: { debug: console.log.bind(null,"OrientDB: ") }
});

... bunch of stuff here, then :


  client
    .connect()
    .then(() => {
      return client.sessions({
        name: "userDBName",
        user: "userId",
        password: "userPassword",
        rootUser: "rootId",
        rootPassword: "rootPassword",
        pool: {
          max: 25
        },
        logger: { debug: console.log.bind(null,"OrientDB: ") }
      });
  })
  .then(pool => {
    console.log('loading bootstrap pool ...')
    boostrap(pool);
  })
  .catch(err => {
    console.log(err);
  });
Posted by: Guest on November-03-2020

Code answers related to "Javascript"

Browse Popular Code Answers by Language