SQLAlchemy 7.1
----------------------------

I'm currently using sqlalchemy with a lot of begin/inserts/commits that
allows me to make sure to have an atomic, stable save of my actions (but I
only need a snapshot of my object at one time: my requests are consistent
enough to avoid any database changes problems). The whole thing run pretty
fast as I set the expire_on_commit argument of the sessions to False (and I
don't need my objects to be updated).

Also, I'm using some database integrity constraint violation to avoid doing
some useless (and costly) selects.

Here comes the problem: when an Integrity errors occurs, a rollback is done
and every sqlalchemy records are expired, thus, the insert takes 3.42
seconds... and 3.41 seconds are spent on the "restore snapshot" function ...

Setting the Session's argument "_enable_transaction_accounting" to False
solves the problem, ( the whole thing taking 0.012 s) but the "legacy" side
of this argument is problematic as it may disappear/not be maintained/Tested
in future versions of the library...

Does anyone have a better/less ugly way to do this with comparable
performances ?

Thanks

-- 
You received this message because you are subscribed to the Google Groups 
"sqlalchemy" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to 
[email protected].
For more options, visit this group at 
http://groups.google.com/group/sqlalchemy?hl=en.

Reply via email to