Re: Exception exceptions.AttributeError - Depending upon the naming of the module ( connector.py / error_connector.py)
Senthil Kumaran <[email protected]>
| Newsgroups | gmane.comp.python.egenix.user |
|---|---|
| Message-ID | <[email protected]> |
On Tue, Feb 10, 2009 at 3:38 AM, M.-A. Lemburg <[email protected]> wrote: > At interpreter exit time, Python will clear all modules, but the > order in which this happens is undefined (in CPython it depends on > the order of the items in the module dictionary at the time of exit, > but that's an implementation detail of CPython). Thanks for the explanation, Marc. That helped. > It is better to keep globals such as the session object in > a context object that you pass around in your application > code as parameter to the various methods/functions. If I understand it properly, you recommend: class A: def __init__(): ... self.connection = DriverConnect() ... objA = A() And call stormedDB = StormifyDatabase(objA) If I have mis-understood. can you please point me to any example snippets which I can look at and design accordingly. > Note that it's also better to explicitly close the session > object once you're done with the server communication. I would like to do that, the but the point is: user_script.py - has db_api = <ClientSideObject...> Now, I pass this object to storm ORM and the entire application uses the stormified object. Returns the value. I have tried doing .close() on __del__() method of the class where I am opening the ClientSideObject, but still after a "couple of successful executions" (without any error message in the Server.log) I end up at: File "mx/ODBCConnect/Common/ProxyObjects.py", line 675, in __call__ File "mx/ODBCConnect/Client/ServerSession.py", line 614, in methodcall File "mx/ODBCConnect/Client/ServerSession.py", line 423, in _response File "mx/ODBCConnect/Common/ProxyObjects.py", line 1191, in process_response InterfaceError: Connection limit exceeded. Your license allows 20 physical database connections. called from the very same __del__() method. I might share the code at [email protected] for further suggestions. Thank you, Senthil -- -- Senthil _______________________________________________________________________ eGenix.com User Mailing List http://www.egenix.com/ https://www.egenix.com/mailman/listinfo/egenix-users