Skip to content

Conversation

@IlyaFaer
Copy link
Contributor

@IlyaFaer IlyaFaer commented Jun 17, 2022

Fixes #221

@product-auto-label product-auto-label bot added the api: spanner Issues related to the googleapis/python-spanner-sqlalchemy API. label Jun 17, 2022
@IlyaFaer
Copy link
Contributor Author

The errors failing in this PR will be fixed with the PR:
googleapis/python-spanner#750

@IlyaFaer IlyaFaer marked this pull request as ready for review June 20, 2022 06:53
@IlyaFaer IlyaFaer added the kokoro:force-run Add this label to force Kokoro to re-run the tests. label Jun 20, 2022
@yoshi-kokoro yoshi-kokoro removed the kokoro:force-run Add this label to force Kokoro to re-run the tests. label Jun 20, 2022
"""An event of returning a connection back to a pool."""
if dbapi_conn.connection.inside_transaction:
dbapi_conn.connection.rollback()
if isinstance(dbapi_conn.connection, spanner_dbapi.Connection):
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Resetting attributes only in case it's a Spanner connection. Otherwise doing rollback(), which is the default behavior of the resetting method.

@IlyaFaer IlyaFaer requested a review from asthamohta June 20, 2022 07:25
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

api: spanner Issues related to the googleapis/python-spanner-sqlalchemy API.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

AttributeError: 'CMySQLConnection' object has no attribute 'inside_transaction' when using spanner + mysql dialects in separate engines

3 participants