At 10:11 AM 6/11/2001 -0400, Jeff Johnson wrote:
>Hi everyone,
>
>I'm trying to figure out the best way to pool database connections so
>I was looking into how MiddleKit does it.  I noticed this piece of
>code in MSSQLObjectStore.py and didn't know python could do this:
>
>def Klass:
>         def sqlTableName(self):
>                 '''
>                 Returns "[name]" so that table names do not conflict with SQL
>                 reserved words.
>                 '''
>                 return '[%s]' % self.sqlTableName()

It should be "class Klass:". This code has never been tested. The MSSQL 
(Dave Rogers) often splits off from the CVS repository and it takes weeks 
or months to reel him back in. I added this change, but don't have MSSQL to 
test with.

The fix is checked in now.


>I've never seen a class over-ridden with a def statement.  Is that

Neither have I.  :-)


>what this is doing?  Any idea where in the python manuals I could read
>about this?

BTW that class is picked up by MK as a mix-in. Its methods are injected 
into the real Klass located in MiddleKit.Core. This mix-in technique makes 
it convenient for the specific object stores to customize MK without having 
to subclass.


>BTW: Does anyone have a PostgreSQL SQLObjectStore module?  Any advice
>on DB pooling would also be appreciated :)

No, this comes up quite a bit, but no one has tackled it.

We also haven't tackled the DB pooling issue (in MK) yet. I'm thinking 
there could be some relation between MK and Webware.MiscUtils.DBPool but I 
haven't followed it through.


-Chuck


_______________________________________________
Webware-devel mailing list
[EMAIL PROTECTED]
http://lists.sourceforge.net/lists/listinfo/webware-devel

Reply via email to