typeorm / typescript-express-example

Example how to use Express and TypeORM with TypeScript
361 stars 100 forks source link

Is this concurrency-safe? #7

Closed yang closed 6 years ago

yang commented 6 years ago

You have a single createConnection() happening once at the top of this example. I understand that creates a connection pool. But how does TypeORM when it should add vs reuse connections in the pool? (If you have two requests coming in at the same time, and each request handler makes some queries, how does TypeORM know which queries go to which connection?)

yang commented 6 years ago

Moving this discussion to https://github.com/typeorm/typeorm/issues/2581

pleerock commented 6 years ago

Answered in there.