I think you don't have to run the setup_all part on the new app. In cherrypy, for example, you can also do the connection stuff in the request-hook so all the instance use the same connection/session. BV
-----Original Message----- From: [email protected] [mailto:[email protected]]on Behalf Of Randy Syring Sent: Wednesday, January 14, 2009 10:55 AM To: SQLElixir Subject: [elixir] Sharing Entities Across Web Applications -- Meta Data Binding Problem I am building a web framework, kind of like Pylons, but which has a concept called "supporting applications." That means I can create a base application (lets call it "basapp") and then I can setup custom applications based on baseapp. Inherent in the concept of "supporting applications" is being able to use and/or inherit (from a python object perspective) the model defined in the supporting application. I am currently using Elixir, but am running into the following problem with this setup. So, lets say that my baseapp defines a User Entity (UE). My main application (lets call it "app1") needs a UE and uses the UE from baseapp (a simple python import). When app1 is first initialized, my framework recognizes that app1 uses baseapp, so it initializes all of baseapp's entities (including UE) and uses app1's metadata to do so. Therefore, app1 can use the UE and everything works fine. However, like Pylons, I want to support running multiple web applications in the same process and this is where I run into nothing but headaches. When I initialize the second application ("app2"), the python modules where UE is defined have already been compiled/loaded by the app1 initialization routine. Therefore, the metadata for app2 is empty, because the UE entity has already been created and doesn't get created a second time. I think what I would like is for UE to not be bound to metadata/ session at run time but be bound later (i.e. on each request to a web application). Am I thinking about this correctly? I would appreciate any input on helping me think through the correct way to implement this. The information contained in this message and any attachment may be proprietary, confidential, and privileged or subject to the work product doctrine and thus protected from disclosure. If the reader of this message is not the intended recipient, or an employee or agent responsible for delivering this message to the intended recipient, you are hereby notified that any dissemination, distribution or copying of this communication is strictly prohibited. If you have received this communication in error, please notify me immediately by replying to this message and deleting it and all copies and backups thereof. Thank you. --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "SQLElixir" 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/sqlelixir?hl=en -~----------~----~----~----~------~----~------~--~---
