i just want to stress that I could be wrong.  It sounds like you're having 
problems with Transaction and Rollback.  I'd dig deep into:

1. `pyramid_tm` and `transaction` + zope sqlalchemy extension
2. your use of local vs global sessions

i don't use pyramid_tm but have been migrating my code to use it ( i didn't 
realize it handled savepoints, which we needed; and we're waiting on some 
patches to repoze.sendmail that enable savepoints to be approved )

I recall that something in one of those packages did something to both find 
and revert the sqlalchemy session(s) ; but i can't recall how/where it's 
done or if there's any special setup.

the zope sqlalchemy docs do state 
( https://pypi.python.org/pypi/zope.sqlalchemy) :

"A new transaction requires a new session. Let's add an address."

nothing in pyramid_tm touches the session.

looking at the zope.sqlalchemy source, it looks like the session it bound 
to the transaction

https://github.com/zopefoundation/zope.sqlalchemy/blob/master/src/zope/sqlalchemy/README.txt

"

Call the scoped session factory to retrieve a session. You may call this as
many times as you like within a transaction and you will always retrieve the
same session. At present there are no users in the database."

And then again we see:

> A new transaction requires a new session. Let's add an address.


so i could be wrong on all this.  but your lack of an explicit new 
DbSession() per request seems to be an issue.

good luck. i'd love to know the cause/fix.

-- 
You received this message because you are subscribed to the Google Groups 
"pylons-discuss" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To post to this group, send email to [email protected].
Visit this group at http://groups.google.com/group/pylons-discuss.
For more options, visit https://groups.google.com/groups/opt_out.


Reply via email to