orientechnologies / orientjs

The official fast, lightweight node.js client for OrientDB
http://orientdb.com
Other
326 stars 68 forks source link

From the beginning until the end. What and when supposed to be performed ? #344

Closed petervavro closed 5 years ago

petervavro commented 6 years ago

Could you please specify when the following tasks are supposed to be performed from Node JS Architecture point of view.

Thank you !

wolf4ood commented 6 years ago
  • OrientDBClient.connect > ? (e.g. Before server is created ?)

At the boostrap of your application

  • client.sessions > ?

At the boostrap of your application

  • pool.acquire() > ?

When you need a session in the request for doing queries

  • session.close() > ? (e.g.: After request ?)

When you are done with your logic

  • pool.close() > ?

At the shutdown of the application

  • client.close() > ? At the shutdown of the application
wolf4ood commented 6 years ago

You can find an example here in a simple chat application with ExpressJS

https://github.com/orientechnologies/orientjs-example

wolf4ood commented 6 years ago

Hi @petervavro

i've added the same example rewritten with async/await.

https://github.com/orientechnologies/orientjs-example

Let me know if it helps

myflowpl commented 6 years ago

Good question! Answer should be added to the docs!