Sunday, November 09, 2008

Recycle OWSTimer too!

I've been back to working on my keyword processing sharepoint list (coming along quite well, BTW). The main goal of this list is to be able to take a list entry that was emailed in and automatically fill in column values for that item. Since sharepoint scans for inbound emails once a minute, though, to speed testing I put list items in using the web interface. Everything was working great, so I decided to start trying it with emails.

Now, a little background on the list--I don't know how (or if it's even possible) to add custom properties to my list. The only centralized place that I could figure out to store my keyword definitions is in a list entry with a specific subject. (If anyone knows a better way, please let me know.) Since I didn't want to be troubleshooting my CAML queries at the same time, I just put the keyword definitions for testing right into the code. Once I got the actual processing code working, I changed the code to start pulling from a list entry with a title of "KEYWORDXML".

Now, back to the story. I sent in an email, and it seemed to work. One of the options in the definition for each keyword is whether or not the keyword should be removed from the title. I had one removing, and one staying. I decided to try pulling both, because it it more difficult than it sounds. :) I emailed in a post, and only one keyword was removed. I posted on the web interface, and both were removed. I kept dorking with it, ultimately removing my "KEYWORDXML" post to see that, with the web interface, it didn't process any keywords in the title. If I emailed, it still processed them in the same way that it did when I started testing. What is going on?

It finally hit me. After every deploy, I would do an IISReset, or else the web interface wouldn't start using the new code. I looked at the sharepoint log, and it turns out that, while w3wp.exe was processing the stuff I did on the web interface, owstimer.exe was processing anything emailed in. Turns out I need to reset the Sharepoint Timer interface as well--the timer was still using the *original* code that I had published, with the keyword definitions embedded into the code.

No comments: