On Tuesday, 6 March 2018 21:12:01 UTC+1, Mike Bayer wrote:
>
> On Tue, Mar 6, 2018 at 2:52 PM, KCY <kevi...@hotmail.com <javascript:>> 
>> wrote: 
>> > First off thank you for the quick reply. I have seen those resources 
>> you 
>> > linked a few days ago and it guided me partially to my current ideas. 
>> The 
>> > RepositoryContext class is essentially the contextmanager example with 
>> some 
>> > extra helper methods. 
>> > 
>> > I think in trying to keep my example concise I left out too much detail 
>> to 
>> > illustrate the potential problem I'm trying to avoid. To expand upon 
>> it, I 
>> > can imagine a scenario where there are 2 branches, each with their set 
>> of 
>> > leaves. In a scenario with some tabbed UI where both branches are 
>> "open" 
>> > some editing happens on both but that the intention upon saving is to 
>> only 
>> > save the current tab's branch but not commit any of the other changes. 
>>
>> OK so within the scope of "editing" that's where I'd put transactional 
>> scope.    E.g. transaction per tab.  But I wouldn't leave these 
>> transactions open for an event-driven GUI waiting for input, only when 
>> it's time to manipulate the state of the database. 
>>
>
That seems like a good idea, I'll have to experiment a bit to see what we 
end up with.

I'll post an update once I have a more fleshed out solution for anyone else 
who is interested.

-- 
SQLAlchemy - 
The Python SQL Toolkit and Object Relational Mapper

http://www.sqlalchemy.org/

To post example code, please provide an MCVE: Minimal, Complete, and Verifiable 
Example.  See  http://stackoverflow.com/help/mcve for a full description.
--- 
You received this message because you are subscribed to the Google Groups 
"sqlalchemy" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to sqlalchemy+unsubscr...@googlegroups.com.
To post to this group, send email to sqlalchemy@googlegroups.com.
Visit this group at https://groups.google.com/group/sqlalchemy.
For more options, visit https://groups.google.com/d/optout.

Reply via email to