On Friday 03 May 2002 06:55 am, Costas Malamas wrote: > Well, I am convinced, I'll go ahead and try it out. > > What I am not following from the docs though is how do you use > DBPool; I am not familiar with threading (at all!), so I don't get > the setup. E.g. do you call DBPool once in your application (somehow > have a central DBPool that you get connections from) or do can you > call it whenever you need a connection and it will "know" which > connection to give back? I am guessing the former --in which case, > where in WK is the best place to put it? subclass Application?
Every time you think of subclassing Application just to store application wide resources, you could just as easily (or more easily) get along with a module for this purpose and put the objects in module level variables. This might also lead to further uses of that module in other settings. Surprisingly, there is not yet a Wiki page on this that I see. Looking back at the MiddleKit code that uses the DBPool, it simply gets a connection like this: conn = self._pool.getConnection() So as you guessed, you ask the pool for a connection whenever you need one. When you lose the reference to the connection, it will go back in the pool for other threads to use. Maybe the doc string needs further improvement. -Chuck _______________________________________________________________ Have big pipes? SourceForge.net is looking for download mirrors. We supply the hardware. You get the recognition. Email Us: [EMAIL PROTECTED] _______________________________________________ Webware-discuss mailing list [EMAIL PROTECTED] https://lists.sourceforge.net/lists/listinfo/webware-discuss