On 2/14/10 19:54 , Antoine Pitrou wrote:
Le dimanche 14 février 2010 à 19:45 +0100, Wichert Akkerman a écrit :

That is by design: zope.sqlalchemy (which is really the thing you are
complaining about) forces you to commit the entire transaction. This is
required to coordinate transactions between multiple participants in a
transaction, prevent one of them from getting out of sync.

I understand this is by design, but better again would have been a flag
to disable it.

I have never seen a request for such a flag before, which makes me suspect it is not a widely requested feature. You are more than welcome to contribute such a flag to zope.sqlalchemy though.

And transaction.commit() has the annoying "side effect" that it will
also purge the session afterwards, making all your objects unusable
unless you go out of your way to fetch them again manually.

Iirc it starts a new session, making sure that you do not leak things
between transactions.

Well, there are situations where you'd want to "leak" things between
transactions... If SQLAlchemy itself doesn't enforce it, I'm not sure
why the "transaction" package thinks it should.

If you are trying to put blame anywhere do it in the right place: the 'transaction' package does not do this. The SQLAlchemy transaction glue in the zope.sqlalchemy package does.

Wichert.

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

Reply via email to