If I do this:
item1 = Item() # a new item
self.sess.add(item1)
self.sess.begin(subtransactions=True) # sub transaction
item2 = Item() # another
self.sess.add(item2)
self.sess.rollback() # rollback sub trans
cnt = self.sess.query(Item).count() # how many?
That
nested = uses SAVEPOINT. This is the technique the average user wants to
use.Background: http://en.wikipedia.org/wiki/Savepoint
subtransactions = a code nesting technique. Is only enabled via a flag so
that the feature isn't inadvertently used, since it is generally an advanced
On 11/1/2010 10:19 AM, Michael Bayer wrote:
SAVEPOINT. This is the technique the average user wants to use.
Thanks for that.
Pertinent documentation: begin(): When a rollback is issued, the
subtransaction will directly roll back the innermost *real* transaction.
rollback(): This method rolls
OK I think in this case, as in many others, is that subtransactions are not
an easy to learn feature, hence it is controlled by a flag that is off by
default. With features like that, there is simply no way to write a paragraph
that will unconditionally impart the correct meaning - only
On 01/11/2010 15:19, Michael Bayer wrote:
nested = uses SAVEPOINT. This is the technique the average user wants
to use. Background: http://en.wikipedia.org/wiki/Savepoint
How do you roll back to a savepoint in SA?
Chris
--
Simplistix - Content Management, Batch Processing Python Consulting
*headslap*
(note to observers - Chris and I are buds ! I kid)
http://www.sqlalchemy.org/docs/orm/session.html#using-savepoint
On Nov 1, 2010, at 1:05 PM, Chris Withers wrote:
On 01/11/2010 15:19, Michael Bayer wrote:
nested = uses SAVEPOINT. This is the technique the average user wants
On 11/1/2010 11:33 AM, Michael Bayer wrote:
OK I think in this case, as in many others, is that subtransactions are not
an easy to learn feature, hence it is controlled by a flag that is off by default. ...
... for features that aren't intended for typical use
Then perhaps say that. This
On Nov 1, 2010, at 2:08 PM, Michael Hipp wrote:
On 11/1/2010 11:33 AM, Michael Bayer wrote:
OK I think in this case, as in many others, is that subtransactions are
not an easy to learn feature, hence it is controlled by a flag that is off
by default. ...
... for features that aren't
On Nov 1, 2010, at 3:12 PM, Michael Bayer wrote:
On Nov 1, 2010, at 2:08 PM, Michael Hipp wrote:
On 11/1/2010 11:33 AM, Michael Bayer wrote:
OK I think in this case, as in many others, is that subtransactions are
not an easy to learn feature, hence it is controlled by a flag that is off
On 11/1/2010 3:12 PM, Michael Bayer wrote:
new section:
http://www.sqlalchemy.org/docs/orm/session.html#using-subtransactions
This section now attempts to explain the full purpose and rationale of the
subtransactions feature including an example. Hope it's clear.
Thank you, looks
Hello!
I am dealing with Turbogears and SQL Alchemy. I need to make one
import from a CSV file to a MySQL DB. I need also to controll which
rows fails on import. I am working with the next code inside a loop:
try:
session.begin(subtransactions=True)
On Oct 14, 2010, at 11:40 AM, Juan Antonio Ibáñez wrote:
Hello!
I am dealing with Turbogears and SQL Alchemy. I need to make one
import from a CSV file to a MySQL DB. I need also to controll which
rows fails on import. I am working with the next code inside a loop:
12 matches
Mail list logo