I am using sqlalchemy in a pylons that is largely readonly. When I
perform an ORM query, the query objects are saved in the current
session and I have to manually clear the session at the end of each
request. So I have a couple questions:

1) is it possible to perform queries with no default session? That is,
the instances returned will be detached automatically

2) is it possible to have instance objects be readonly in some cases?
That is, when performing readonly actions, attempting to set
properties on the instance object will raise an error? Somebody on IRC
pointed me at using multiple mappers for the same class, but I'm not
sure this does what I want because the docs say "Objects that are
loaded with a secondary mapper will have their save operation
processed by the primary mapper"

3) Is creating/deleting a session an expensive operation? Could I for
example create a new session for each HTTP request and then just get
rid of it at the end of the request without explicitly clearing it?

4) Can mapped instance objects be pickled safely? I tried to cache
query results using myghty caching to file but it ends up leaking the
objects that were pickled. When the objects are unpickled, are they
associated with the default session or are they created detached?


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

Reply via email to