Christoph Zwerschke wrote:
> Toshio Kuratomi schrieb:
>> Christoph Zwerschke wrote:
>>> I just found the following in the SA 0.4.3 changelog which could be 
>>> the cause of the problem:
>>>
>>>      - Every Session.begin() must now be accompanied by a
>>>        corresponding commit() or rollback() unless the session is
>>>        closed with Session.close().  This also includes the begin()
>>>        which is implicit to a session created with
>>>        transactional=True.  The biggest change introduced here is
>>>        that when a Session created with transactional=True raises
>>>        an exception during flush(), you must call
>>>        Session.rollback() or Session.close() in order for that
>>>        Session to continue after an exception.
>>>
>> If so, perhaps this ticket would help with the solution:
>> http://trac.turbogears.org/ticket/1721
>>
>> I have a patch there but jek thinks there should be a better way. 
>> Neither of us have studied the code enough to know for sure, though.
> 
> I have analyzed the problem and yes, the above change was what broke TG 
> with SA 0.4.3 (only the first sentence applies, since TG does not use 
> transactional sessions). When TG issued it's automatic commit() at the 
> end of a request and this commit() failed (e.g. because of duplicate 
> entries in the database), then the session was left in an undefined 
> state, and the next request in the same thread would raise an error when 
> trying to call session.begin().
> 
> This is fixed in r4129 by always closing the session.
> 
> So TG 1.0 should now be compatible with SA 0.4.3.

That should be a big help in general: a scoped_session needs to be 
closed after each request in any version.  If there's a request path 
that avoids sa_rwt, that path should get a close as well.


--~--~---------~--~----~------------~-------~--~----~
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