Skip to content
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

feat: add nested transaction #8541

Merged
merged 8 commits into from Feb 26, 2022
Merged

feat: add nested transaction #8541

merged 8 commits into from Feb 26, 2022

Conversation

mortezaPRK
Copy link
Contributor

@mortezaPRK mortezaPRK commented Jan 18, 2022

Description of change

Add nested transaction support.

Implemented following drivers:

  • mysql
  • postgres
  • mariadb
  • sqlite
  • react-native
  • nativescript
  • sqljs
  • oracle
  • better-sqlite3
  • capacitor

Following drivers also support nested transaction. but I'm not familiar with them:

  • cockroachdb
  • mssql
  • aurora-data-api
  • aurora-data-api-pg
  • expo

May be someone else can implement it in another PR

Fixes: #1505

Pull-Request Checklist

  • Code is up-to-date with the master branch
  • npm run lint passes with this change
  • npm run test passes with this change
  • This pull request links relevant issues as Fixes #1505
  • There are new or updated unit tests validating the change
  • Documentation has been updated to reflect this change
  • The new commits follow conventions explained in CONTRIBUTING.md

This is WIP. if implementation is acceptable, I'll add other drivers and tests

@pleerock
Copy link
Member

Thank you for your contribution, looks really good. Considering simplicity of the suggested solution, I just wanted to ask you if you have a time to investigate other drivers as well, because:

cockroachdb - should be same as postgres if they support it
aurora-data-api - should be same as mysql
aurora-data-api-pg - should be same as postgres
expo - should be same as sqlite
mssql - would be really nice to have since others are implemented

@mortezaPRK
Copy link
Contributor Author

sure. I'll give it a try tomorrow

This will allow nested transaction for postgres driver using "save point"

Closes: #1505
@mortezaPRK
Copy link
Contributor Author

@pleerock

I added other drivers except for mssql. I wasn't able to implement it :(

@AlexMesser AlexMesser merged commit 6523526 into typeorm:master Feb 26, 2022
@AlexMesser
Copy link
Collaborator

thank you for contribution!

@mortezaPRK mortezaPRK deleted the add-nested-transaction-support branch March 12, 2022 14:37
ishiahirake added a commit to ishiahirake/typeorm that referenced this pull request Apr 15, 2022
@xfishernet
Copy link

I try this example and it still doesn't work for me :-(

#1505

@Gideon-Felt
Copy link

Is mssql still not capable of using this feature?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Nesting transactions
6 participants