On Apr 8, 2007, at 5:54 AM, Arun Kumar PG wrote:

> Hi All,
>
> Can we initialize metadata one time (let's say during the first  
> time application access) , store the same in the global context and  
> then reuse the already intialized metatada for catering multiple  
> requests ? Any threading related issues ?
>

metadata / engine is meant to be a global object thats used across  
threads.  its the individual Connections and Transactions usually  
need to be kept in one thread (and Sessions if youre using ORM).

>
> Application Initialization -> create engine and bound metadata ->  
> Load all tables (i.e. create Table objects, autoload=True) -> Map  
> tables and classes -> Store Metadata and loaded Tables in a user  
> defined Factory class
>
> When ever application gets subsequent requests the below will happen:
>
> Get the required table objects/metadata from the above factory ->  
> create session -> do whatever --> flush/close session.
>
> Also, the application can get multiple concurrent requests.
>

thats pretty much the model, yeah.



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