On Monday 28 May 2007 23:43:37 Michael Bayer wrote: > On May 28, 2007, at 3:33 AM, [EMAIL PROTECTED] wrote: > > To avoid trouble if erasing fails, i may also add some sort of > > state-flag "is_temporary" to all those records, so they can be > > visible within the transaction (flag is True), but not outside - > > without the flag being cleared. Thus if removing fails, the > > records will stay without affecting the overall result. (Of > > course all queries should have additional filter on that flag for > > this to work.) > > > > Do u see any problem with this? > > > > hmm.. with this flag i may even not need to keep track of changes > > - just 'Delete from ... where flag=true...' > > seems like it will work but also seems really tricky. I feel like > if I were doing this application i would rearrange things at some > higher level to either prevent the need for nesting of transactions > or to redefine exactly what determines data that can be "rolled > back" post transaction...you know something semantically more > specific than "is temporary". when a DB design starts needing so > much application logic embedded into it like that, it signals that > something is wrong in the bigger sense (i.e. its an "architecture" > / "assumptions" smell). > i was thinking this too.. so far the only fix is that it will not be just a bool flag, but a root-user-transaction-id; when 0, all is visible; else rows are visible only to that user-transaction-and-subtransactions. id's would be coming from some db-sequence. heh, thus it can span through many user-sessions... lets see if i can find usage of this. something like temporary /unfinished documents and related stuff... it'll need some "optimizations", e.g. copy-on-write-like, otherwise just opening then closing that bloody dialog would create quite a traffic to duplicate whole structure parent+relations then remove it.
ciao svil --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "sqlalchemy" group. To post to this group, send email to sqlalchemy@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/sqlalchemy?hl=en -~----------~----~----~----~------~----~------~--~---