From: Jason H. <ja...@pe...> - 2003-02-24 18:05:31
|
On Mon, 2003-02-17 at 22:59, Martin Virtel wrote: > Hi, > > almost every servlet of my WebKit context relies on the same MiddleKit store > being available. Currently, I do keep a global array of initialized stores, the > servlet gets one when it does awake() and puts it back into the array within > the sleep() function. > > I wonder if there's a better way to do it, such as making my context a plugin > and initializing only one store in the __init__.py file or the > InstallInWebKit() function, taking advantage of the 'SQLConnectionPoolSize' > setting for the MiddleKit store. > > So how should I do this? Can several servlet instances share the same store in > a thread safe way? Hi Martin, Found this message from last week, but it doesn't look like you ever got a reply. FWIW, I use a single global store which is shared by all my servlets. In terms of thread-safety, you just have consider situations where the same MiddleObject might be used/modified by two users simultaneously, and whether this could cause problems. Depending on your app this may not be likely or even possible. See http://webware.colorstudy.net/twiki/bin/view/Webware/MiddleKitAndWebKit for a "standard" way to set initialize MiddleKit from a WebKit app. cheers, Jason |