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: changed to use transaction instead of managing sessions manually. And only when a transaction is needed #14

Merged
merged 3 commits into from
Feb 21, 2024

Conversation

javierdelafuentesales
Copy link

@javierdelafuentesales javierdelafuentesales commented Feb 21, 2024

Description of change

Stop opening sessions manually. Based on the spanner code, this should not be done.
https://github.com/googleapis/nodejs-spanner/blob/65f6a838be9f526cb2c1497c66345ef2949e35d4/src/session.ts#L77

Use database.getTransaction instead and only when a transaction is needed.

We want to do this as we have realised that we are constantly creating and deleting sessions in spanner

image image

We hope that this will improve the performance.

@javierdelafuentesales javierdelafuentesales changed the title feat: changed to use transaction only when needed feat: changed to use transaction instead of managing sessions manually. And only when a transaction is needed Feb 21, 2024
@javierdelafuentesales javierdelafuentesales merged commit d50246d into main Feb 21, 2024
1 check passed
@javierdelafuentesales javierdelafuentesales deleted the stop-using-manual-sessions branch February 21, 2024 16:29
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.

2 participants