2011/7/23 Michael Bayer mike...@zzzcomputing.com
On Jul 23, 2011, at 5:37 AM, Moch Ramis wrote:
expunge() will remove any object from the Session
This look a little dumb, but it seems this will solve my problem:
expunged objects will not be expired by the session anymore and their data
expunge() will remove any object from the Session
This look a little dumb, but it seems this will solve my problem: expunged
objects will not be expired by the session anymore and their data will still
be accessible don't they? (I'm not certaint about the last point)...
I'm not sure what
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
2011/7/22 Michael Bayer mike...@zzzcomputing.com
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 ...
well the reason for
2011/6/30 Michael Bayer mike...@zzzcomputing.com
2011/6/30 Michael Bayer mike...@zzzcomputing.com
This looks like you have 49000 calls to session.commit(), so, depending on
what you're doing, I'd reduce the number of commit calls down to one, after
the entire series of insert operations is
SQAlchemy 0.7.1 / pyscopg 2.2.4 / PostgreSQL 8.4
--
Hello everyone.
I recently profiled a task that was making an abusive use of inserts and
queries through sqlalchemy after having requested 1094 objects from the
Thanks for your fast answer.
2011/6/30 Michael Bayer mike...@zzzcomputing.com
This looks like you have 49000 calls to session.commit(), so, depending on
what you're doing, I'd reduce the number of commit calls down to one, after
the entire series of insert operations is complete.
2011/6/15 Michael Bayer mike...@zzzcomputing.com
Assuming you're talking about the ORM. You can of course emit the exact
SQL you refer to any time using execute() from an engine, connection, or
session. The ORM works within a transaction at all times.so an
expression like:
myobject =
Hello.
I am trying to create a transaction that should insert a value
depending of the result of a select. This should be done at once by
the database in order to avoid some conflicts or duplicates.
An equivalent sql version of the transaction would be :
IF EXISTS (SELECT * FROM Table1 WHERE