It has been almost two years, but I have once again hit an abend in
MiddleObject.py (line 75 in 8.1):
    assert len(cache)+1==len(row)

On my last reported incident, I had been encountering this problem
every several months, and the suggestion was made to upgrade to 7.1.
That seemed to have fixed the problem until today.

I think the problem is caused by:
  1. a freshly atarted AppServer
  2. a flurry of incoming transactions all trying to access a MySQL
table that has not been accessed before.

Once the problem occurs, all attempts to access that same table
continue to fail until the AppServer is restarted.

On my latest abend, clicking the Complete button for the variable
"cache" in the fancy traceback yields the following. Note all the
methods are duplicated in this instance, thus, the assert failed.

Full representation:
[<unbound method Folder.setFileName>, 
<unbound method Folder.setSurveyDate>, 
<unbound method Folder.setLockUserId>, 
<unbound method Folder.setPhotographer>, 
<unbound method Folder.setComments>, 
<unbound method Folder.setRootId>, 
<unbound method Folder.setSiteId>, 
<unbound method Folder.setNumberFiles>, 
<unbound method Folder.setUpdatedBy>, 
<unbound method Folder.setUpdateTime>, 

<unbound method Folder.setFileName>, 
<unbound method Folder.setSurveyDate>, 
<unbound method Folder.setLockUserId>, 
<unbound method Folder.setPhotographer>, 
<unbound method Folder.setComments>, 
<unbound method Folder.setRootId>, 
<unbound method Folder.setSiteId>, 
<unbound method Folder.setNumberFiles>, 
<unbound method Folder.setUpdatedBy>, 
<unbound method Folder.setUpdateTime>]

I think the solution is to insert a lock around the code that deals
with loading the cache the first time a table is accessed. At the top
of the MiddleObject.py add:

import thread # 2002-08-21 rdh
_cacheLock = thread.allocate_lock() # 2002-08-21 rdh

Then modify the block starting at line 64 to insure only one thread
gets to load the cache at a time:

        if not cache: # 2002-08-21 rdh
            _cacheLock.acquire() # 2002-08-21 rdh
            if not cache:
                allAttrs = self.klass().allDataAttrs()
                # @@ 2000-10-29 ce: next line is major hack:
hasSQLColumn()
                attrs = [attr for attr in allAttrs if
attr.hasSQLColumn()]
                attrNames = [attr.name() for attr in attrs]
                assert len(attrNames)+1==len(row)  # +1 because row has
serialNumber
                for name in attrNames:
                    setMethodName = 'set' + name[0].upper() + name[1:]
                    setMethod = getattr(self.__class__, setMethodName,
'_'+name)
                    cache.append(setMethod)
            _cacheLock.release() # 2002-08-21 rdh

Roger Haase




        
                
__________________________________
Do you Yahoo!?
Yahoo! Domains � Claim yours for only $14.70/year
http://smallbusiness.promotions.yahoo.com/offer 


-------------------------------------------------------
This SF.Net email is sponsored by: Oracle 10g
Get certified on the hottest thing ever to hit the market... Oracle 10g. 
Take an Oracle 10g class now, and we'll give you the exam FREE.
http://ads.osdn.com/?ad_id=3149&alloc_id=8166&op=click
_______________________________________________
Webware-discuss mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/webware-discuss

Reply via email to