RE: Potential Work-Around to handeling Notes crashed with PANIC or OleMainThreadWndName. John Battista 9.Aug.01 07:03 PM a Web browser Domino Designer -- Agents All ReleasesAll Platforms
First, Thanks for all your postings and this collection of information. It has been very helpful.
Now, to describe a recent problem, and work-around regarding the subject errors.
I recently wrote some agents for use bye a browser which basically obtained several documents from two several databases, did some comparisons and computations, and then generated several new documents representing the results and placed them into a db. The agent used several classes which I had written. This agent seemed to work fine when I called it a single time, but when I started calling it repetatively (basically running itself on all documents in a view) it began to give the Panic error. This seemed very strange given that it didn't always happen, nor did it always happen at the same spot. I also, as a test, tried having the agent run automatically through AgentMGR and this resulted in the OLEMainThreadWndName Error.
OK, so I started researching the problem in this forum and probably read almost every posting regarding the two errors and tried all of the following:
- Tried running the agent on a different server
- Upgraded Domino Server to 5.08
- Upgraded the designer client to 5.08
- Recompiled my code with the new versions
- Changed some GetDocumentByKey methods to be sure they used a String varriable and not a variant
- Removed some processes from the server
- Removed StatRep from Windows NT
Basically tried everything that had been posted and nothing worked. I finally noticed a configuration of documents and information which caused the server to crash in the same place every time. I was then able to pinpoint the line of code which was causing the crash, which read:
mvTemp1 = Arrayreplace(mvAffectedQuestions, mobjRuleElements(iCount).AffectedQuestion, mvTemp2)
The second argument to the arrayreplace is a class property which I had written. This returns a variant containaing a list.
I added a line seting a variant varriable
mvTemp3 = mobjRuleElements(iCount).AffectedQuestion
and updated the original line of code to read:
mvTemp1 = Arrayreplace(mvAffectedQuestions, mvTemp3, mvTemp2)
This simple change seems to have corrected the problem with the server crashing. I have writen another agent to call the offending agent multiple times and so far it has not crashed the server.
Based on this result, and some of the postings I noticed indicating that the GetDocumentByKey method were having the same issues I am beginning to believe that maybe Notes/Domino is having trouble using object references as arguments to functions and other objects. Obviously I have not done extensive testing, but it seems like we have two documented occurences of this and it might be worth some folks at IRIS to do some more testing in this area.
In any case, I hope this is helpful to you and anyone else in the forum with similar problems.
Feel free to contact me at email@example.com