On 2/14/10 19:02 , Antoine Pitrou wrote:
Le dimanche 14 février 2010 à 17:47 +0000, Chris Withers a écrit :
Wichert Akkerman wrote:
On 2010-2-9 09:48, Chris Withers wrote:
I know that zope's transaction package aims to do just this, I wonder if
anyone's used that, or anything else, with SA to solve this problem?

You mean ZODB's transaction package?

it's actually now just a standalone package ;-)

http://pypi.python.org/pypi/transaction

I've found it to be an active nuisance. For example it will forbid the
use of commit() on the session, forcing you to use transaction.commit()
instead.

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.

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.

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