Environment details
- Programming language: Python
- OS: OSX
- Language runtime version: 3.9
- sqlalchemy-spanner version: 1.1.0
- google-cloud-spanner version: 3.14.0
Steps to reproduce
>>> import uuid
>>>
>>> from sqlalchemy import create_engine
>>> from sqlalchemy.dialects import registry
>>> from sqlalchemy.orm import sessionmaker
>>>
>>> from app import models #https://github.com/kazshinohara/spanner-sqlalchemy-demo/blob/main/app/models.py
>>>
>>> registry.register("spanner", "google.cloud.sqlalchemy_spanner", "SpannerDialect")
>>> engine = create_engine("spanner:///projects/***/instances/demo/databases/ranking")
>>> SessionLocal = sessionmaker(autocommit=False, autoflush=False, bind=engine)
>>>
>>> new_user = models.Users(user_id=str(uuid.uuid4()), name="Fuga")
>>> session = SessionLocal()
>>> session.add(new_user)
>>> session.commit()
Exception during reset or similar
Traceback (most recent call last):
File "/Users/kazshinohara/Library/Caches/pypoetry/virtualenvs/spanner-sqlalchemy-demo-refH8cY9-py3.9/lib/python3.9/site-packages/sqlalchemy/pool/base.py", line 697, in _finalize_fairy
fairy._reset(pool)
File "/Users/kazshinohara/Library/Caches/pypoetry/virtualenvs/spanner-sqlalchemy-demo-refH8cY9-py3.9/lib/python3.9/site-packages/sqlalchemy/pool/base.py", line 874, in _reset
pool.dispatch.reset(self, self._connection_record)
File "/Users/kazshinohara/Library/Caches/pypoetry/virtualenvs/spanner-sqlalchemy-demo-refH8cY9-py3.9/lib/python3.9/site-packages/sqlalchemy/event/attr.py", line 261, in __call__
fn(*args, **kw)
File "/Users/kazshinohara/Library/Caches/pypoetry/virtualenvs/spanner-sqlalchemy-demo-refH8cY9-py3.9/lib/python3.9/site-packages/google/cloud/sqlalchemy_spanner/sqlalchemy_spanner.py", line 51, in reset_connection
dbapi_conn.connection.rollback()
File "/Users/kazshinohara/Library/Caches/pypoetry/virtualenvs/spanner-sqlalchemy-demo-refH8cY9-py3.9/lib/python3.9/site-packages/google/cloud/spanner_dbapi/connection.py", line 397, in rollback
self._transaction.rollback()
File "/Users/kazshinohara/Library/Caches/pypoetry/virtualenvs/spanner-sqlalchemy-demo-refH8cY9-py3.9/lib/python3.9/site-packages/google/cloud/spanner_v1/transaction.py", line 113, in rollback
self._check_state()
File "/Users/kazshinohara/Library/Caches/pypoetry/virtualenvs/spanner-sqlalchemy-demo-refH8cY9-py3.9/lib/python3.9/site-packages/google/cloud/spanner_v1/transaction.py", line 68, in _check_state
raise ValueError("Transaction is already committed")
ValueError: Transaction is already committed
What I did before getting this error
Just updated the package from 1.0.0 to 1.1.0 according to #205
Along with the packge update, google-cloud-spanner also was updated from 3.13.0 to 3.14.0 in my environment.
Even though downgrading google-cloud-spanner to 3.13.0 / 3.12.0, the same happens.
Here is my all code.
This error is not fatal, the data safely are saved in Spanner but very noisy & vague.
Looks like it's very similar with #103
Let me know if you need further information from my side.
Environment details
Steps to reproduce
What I did before getting this error
Just updated the package from 1.0.0 to 1.1.0 according to #205
Along with the packge update, google-cloud-spanner also was updated from 3.13.0 to 3.14.0 in my environment.
Even though downgrading google-cloud-spanner to 3.13.0 / 3.12.0, the same happens.
Here is my all code.
This error is not fatal, the data safely are saved in Spanner but very noisy & vague.
Looks like it's very similar with #103
Let me know if you need further information from my side.