From: Florian S. <flo...@gm...> - 2004-07-20 06:11:23
|
On Mon, 19 Jul 2004 11:35:17 -0300, Sidnei da Silva <si...@aw...> wrote: > On Mon, Jul 19, 2004 at 07:27:11AM -0700, Michael Watkins wrote: > | For my purposes I created a singleton class pattern which has a > | get_connection() method and assigns the result of this to each > | SQLObject's _connection property. > > I have used a descriptor for _connection which fetches a connection > from a global per-thread connection cache. That would be an option. I use SQLObject from inside Zope (2.7) and I create a new connection on each request. How can I create a per-thread cache? I didn't work with thread-crossing code yet. Do you use a dictionary with the thread-id as the key? Regards, Florian Schulze |