I was getting similar errors under high load testing (different code: some
of my own db access routines, not webware code). It turned out to be that is
was due to using calls to reload() on some of my modules. This was for
debugging purposes originally. This can cause problems however, and when I
removed the reload() calls, the problem went away.
I found out about this from a post on google (see below)
From: Michael Ernst (mernst@...)
Subject: reload causes unbound methods to fail for old class instances
View this article only
Reloading a module can strand old instances, which refer to the old class
definition, not the new one. Operations that refer to classes (such as an
explicit call to a function defined in a parent class) may no longer
operate because of a type mismatch: they expect objects of the new class,
not the old ones.
During development, I commonly reload modules but don't want to lose (or be
forced to regenerate) my interpreter state. I want to operate on the
existing data with the new method definitions. Is there a way for me to
make that happen?
As a simple example of problem, consider the following module and
interpreter trace. A more common problem (and the one I'm encountering)
has a c2 class which inherits from c1 and one of whose methods explicitly
calls a c1 method via, say, "c1.__repr__(self)". That call fails with the
same TypeError as below.
> -----Original Message-----
> From: webware-discuss-admin@...
> [mailto:webware-discuss-admin@... Behalf Of Luke
> Sent: Tuesday, June 11, 2002 4:02 PM
> To: webware-discuss@...
> Subject: [Webware-discuss] awake()
> We get the following error sporadically (several times at
> once, a set or two
> per week), on a wide variety of pages. I believe all the
> pages that throw this
> error eventually inherit from a derivation of SecurePage,
> however the error (as
> in this example below) often happens before reaching SecurePage.
> Some of the pages have 'canBeReused: 0', others not.
> File ".\WebKit\Transaction.py", line 100, in awake
> File "e:\websites\...\editThingDetail.py", line 17, in awake
> SiteContent.awake(self, trans)
> File "e:\websites\...\SiteContent.py", line 17, in awake
> index.awake(self, transaction)
> TypeError: unbound method awake() must be called with
> instance as first argument
> Any thoughts? We can't duplicate the error on our development server.
> Both servers: Webware 0.7final, Python2.1 (activestate), IIS 5.0.
> In a sweet fruit, we miss the sour.
> In a sour fruit, we miss the sweet.
> Enjoying the fruit, we enjoy life.
> Multimillion Dollar Computer Inventory
> Live Webcast Auctions Thru Aug. 2002 -
> Webware-discuss mailing list