-
Notifications
You must be signed in to change notification settings - Fork 83
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Question: Transaction per request #9
Comments
Hi, As for your question: |
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? :/ |
This is weird... I am using Did you try to test your scenario with pure typeorm? |
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? |
Well, I don't have a lot of experience with Nest (played a bit) It should work IMHO, but cannot vouch for that. |
Ah well I will check it out with sql server tomorrow. I'll let you know what's going on :D and thanks. |
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! ^^, |
Thanks!!! |
could you send the link to the Typeorm issue. |
Hey,
I use Nestjs with Typeorm. I'm not sure it has a point when transaction comes into it.
If node is fully non blocking what's the point of having a single connection but cannot have multiple transactions?
I see that only one transaction is allowed per connection but maybe a transaction queue could solve this problem.
So when two requests hit the same controller method and both requires a transaction the second request will fail since there's another active transaction.
Is this package able to solve this problem?
The text was updated successfully, but these errors were encountered: