Skip to content

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
@javierdelafuentesales javierdelafuentesales deleted the stop-using-manual-sessions branch February 21, 2024 16:29
fbaldi6 pushed a commit that referenced this pull request Dec 16, 2024
…y. And only when a transaction is needed (#14)

* feat: changed to use transaction only when needed

* fix: prevent creating another transaction if there is one active

* refactor: improve readability
fbaldi6 pushed a commit that referenced this pull request Dec 16, 2024
…y. And only when a transaction is needed (#14)

* feat: changed to use transaction only when needed

* fix: prevent creating another transaction if there is one active

* refactor: improve readability
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.

3 participants