Comments (7)
Does this only affect SQLAlchemy 1.4 or above in future mode? Can you share some code to reproduce it?
from sqlalchemy-continuum.
I am currently using SQLAlchemy 2.0 and continuum 1.4 version, i will try to provide you a minimal snipped of code to demo it (i need to extract it from my code)
from sqlalchemy-continuum.
Also which DBMS are you using? I don't really understand what rollback for autocommit would even mean.
from sqlalchemy-continuum.
i am testing it with 3 databases:
- SQLite
- MySQL
- PostgreSQL
All exhibit the same issue, so it's not related to a specific dbms. You can enable autocommit isolation level (for psql and sqlite, for mysql is a bit more tricky) as follows:
engine = create_engine("postgresql+pg8000://postgres:postgres@localhost:5432/test")
connection = engine.connect()
connection.execution_options(isolation_level="AUTOCOMMIT")
transaction = connection.begin()
session = Session(bind=connection)
then, if instead of committing the transaction, you roll it back:
session.close()
# roll back the broader transaction
transaction.rollback()
# put back the connection to the connection pool
connection.close()
while changes to my tables are correctly rolled back, transactions table created by continuum is still populated with transactions that actually never occurred, since we rolled them back.
from sqlalchemy-continuum.
connection.begin
should be a no-op under isolation_level="AUTOCOMMIT"
. You should see warnings in the logs to say so.
from sqlalchemy-continuum.
I'm guessing you don't actually need autocommit semantics, but if you do, have a look at the native versioning plugin.
from sqlalchemy-continuum.
thx
from sqlalchemy-continuum.
Related Issues (20)
- DeprecationWarning: '_app_ctx_stack' is deprecated and will be removed in Flask 2.3. HOT 3
- ModuleNotFoundError: No module named 'six' HOT 2
- Add support to SQLAlchemy 2.0 HOT 22
- Classical Mapping HOT 1
- AttributeError: 'Session' object has no attribute 'transaction' HOT 5
- Make VersionClass.versions a plain list HOT 3
- how to get the version of a set of object at a given point in time / transaction id HOT 1
- AttributeError: '_ProxyImpl' object has no attribute 'dispatch' at configure_mappers step (sqlalchemy v2.0)
- 'enable_active_history' should exclude synonyms. SQLAlchemy 2.0 support issue
- Flask SQLAlchemy Binds support HOT 4
- Updates for SQLAlchemy >= 2.0.22 HOT 10
- Add support for computed fields HOT 4
- SQLAlchemy Continuum tries to add empty rows to the database HOT 2
- Changeset doesn't gather changes in many-to-many relationships HOT 2
- Support MariaDB triggers
- sqlalchemy.exc.SADeprecationWarning on from sqlalchemy_continuum import make_versioned with sqlalchemy > 2 HOT 2
- No version for one to many relationships. HOT 1
- Support for application time periods
- Pytest fails with `sqlalchemy.exc.UnboundExecutionError: This session is not bound to a single Engine or Connection, and no context was provided to locate a binding.` HOT 3
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from sqlalchemy-continuum.