On Thursday 06 November 2008 07:28:41 Adam Ryan wrote:
> Thanks a lot for the reply...
>
> > So to suggest an alternative to this you'd have to describe what
> > additional behavior is needed, such as is it an issue of overly
> > complex filter criterion being inefficient on the server side, or
> > you're trying to reduce the number of persist operations, or some
> > kind of long-transaction-spanning concern.
>
> I'm working on a web application so I suppose the later is of
> concern.
>
> Specifically, once the server has responded, I no longer have a
> handle on the SQLA session or query objects (they've been
> removed/deleted). But, I do have a beaker session, so I guess my
> question is how to best recreate a user's last result set so as to
> perform the user's current manipulation on it.
>
> I can't store the query object in the beaker session because it
> can't be pickled, right?.  So is there a way to dump a string
> representation of a query object, then recreate it and associate it
> with a new SQLA Session?
>
> Or am I missing the obvious?  Thanks again for the help.

i've "invented" a way to deal with long-user-transaction-spanning, by 
taking the transactionism out of db, although that may not apply to 
web apps. Once an user trans starts, it obtains a UserTrans id (just 
row in some table), and all objects created/touched in the 
transaction reference that id. Once the user "commits" the 
transaction, i.e. OK button of the outmost dialog-window, all these 
id's are replaced by None. If user hits Cancel overall, all the (new) 
objects are removed. When an object has non-None user-trans-id, noone 
but that particular user sees it. So that also solves "private" 
issues. In a bitemporal situation (where all updates/deletes become 
also inserts of new versions) this is enough to allow user-trans 
spanning whatever time / ui-workflow - it's not at all db-trans 
anymore. For plain situation where updates are updates and deletes 
are deletes, probably something more would be needed to simulate them 
or restore the status at Cancel.

but as i'mm rereading your stuff, it's more of 
how-to-save-the-user-built-query. u can try a recorder/player 
pattern, if all else fails...

ciao
svil

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"sqlalchemy" 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/sqlalchemy?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to