Comments (9)
Hi,
The goal of this library is to support transaction propagation between methods within the code in a simple manner.
As for your question:
If 2 requests are hitting the same controller method, both will have different entityManager instances in different CLS-Hooked Namespace, so concurrency should be solved.
from typeorm-transactional-cls-hooked.
Thanks for the quick response.
Well I initialize the namespace before the application start as your Readme mentions and I force my controller method to sleep with set timeout for some seconds. If even more requests come in in that time window typeorm says that I already have an active transaction so I'm not able to make a new one. Do you think it is because somehow I receive the same manager instance? :/
from typeorm-transactional-cls-hooked.
This is weird... I am using
getManager()
Did you try to test your scenario with pure typeorm?
These things can also happen because of different DB connection drivers, pools...
from typeorm-transactional-cls-hooked.
Hmm.
I test against Sqlite. Maybe should try with sql server since production environment will be that one.
I'll have a look at this tomorrow. However since i use Nestjs all DI managed by that. So repositories and connections are managed by the Nest container. Do you have de facto experience with nest and typeorm transaction concurrency?
I would be very disappointed if it does not work but It should. Right?
from typeorm-transactional-cls-hooked.
Well, I don't have a lot of experience with Nest (played a bit)
It should work IMHO, but cannot vouch for that.
from typeorm-transactional-cls-hooked.
Ah well I will check it out with sql server tomorrow. I'll let you know what's going on :D and thanks.
from typeorm-transactional-cls-hooked.
Ok, so i have tested with mssql and works fine. It seems that sqlite does not support multiple transactions to be opened at the same time. However i found a thread at typeorm where some queue solution is under discussion.
Sorry for bothering you. Package is awesome! ^^,
from typeorm-transactional-cls-hooked.
Thanks!!!
from typeorm-transactional-cls-hooked.
Ok, so i have tested with mssql and works fine. It seems that sqlite does not support multiple transactions to be opened at the same time. However i found a thread at typeorm where some queue solution is under discussion.
Sorry for bothering you. Package is awesome! ^^,
could you send the link to the Typeorm issue.
from typeorm-transactional-cls-hooked.
Related Issues (20)
- Transactional not rollback excute Promise.all Propagation.REQUIRED HOT 1
- TypeError: typeorm_transactional_cls_hooked_1.runOnTransactionCommit is not a function HOT 1
- Support the latest version of typeorm (v0.3.x) HOT 16
- Transaction(s) stuck after connection limit reached
- How do i get Transaction to work ? Getting ConnectionNotFound error HOT 5
- can't add new command when connection is in closed state
- Transaction not rolling back as expected
- Transactional doesn't work well with Promise.all HOT 1
- use @Transactional() with @Res of nestjs transaction won't close HOT 1
- QueryRunnerAlreadyReleasedError after runOnTransactionRollback HOT 4
- Feature request: make NAMESPACE_NAME exported
- How to test that method uses Transactional decorator? HOT 1
- How to commit the transaction? HOT 4
- EntityManager is Undefined
- Testing Error initializeTransactionalContext() HOT 3
- Transactions not working with multiple DBs (connections) HOT 6
- manager property is undefined when using Propagation 'SUPPORTS' HOT 4
- transaction w/o class method decorator HOT 2
- Transactions does not work with multi tenant application HOT 15
- Transaction doesn't work HOT 3
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from typeorm-transactional-cls-hooked.