On Nov 27, 7:18 pm, James <[email protected]> wrote:
>
> Worked just fine. However, in TG2, using transaction.commit() instead
> of model.session.commit() causes all ORM objects to become
> invalidated, and I need to re-query the DB to get a fresh instance,

Indeed.
Amusingly, SQLAlchemy isn't at fault here. The culprit is Zope's
transaction wrapper (zope.sqlalchemy), which is used throughout
TurboGears 2.

I agree this behaviour is a PITA especially when you want to program
long-running batch tasks. I really wonder why it's the default; I
can't think of any sane explanation.

(for the record, and if I'm not mistaken, the problem is the
`session.close()` statement at the end of SessionDataManager.finish()
in zope.sqlalchemy.datamanager)

--

You received this message because you are subscribed to the Google Groups 
"TurboGears" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to 
[email protected].
For more options, visit this group at 
http://groups.google.com/group/turbogears?hl=en.


Reply via email to