Question

When using the stsadm -o execadmsvcjobs as part of a batch command we are finding that even though the command is saying all the jobs have been run, the jobs haven't necessarily completed.

This means that our next batch job for example activate feature may fail as the solution has not been deployed in time.

We have a delay in the batch file currently to solve this but would like to know if there is a better solution.

all the best

Was it helpful?

Solution

EASJ has several issues.

First of all, there is no guarantee that the deployment succeded after running EASJ. You will have to call ENUMSOLUTIONS and parse the XML returned to see if the deployment wen well.

Secondly, EASJ only checks for jobs in the SPAdministrationServiceJobDefinitionCollection of the current Web Front End server. This is probably what is causing you grief when you activate features: the job might be finished on current WFE, but not on all WFE. Another variation of this is that if you have deployed solutions earlier on WFE#1 and that job somehow was stalled, and you re-deploy the solution on WFE#2 you will get weird warnings about pending jobs etc. This is why it is important to always deploy from the same WFE!

STSADM extension guru and MVP Gary Lapointe has made an extension that should address the later problem, and hence be safe(r) to use in scripts: http://stsadm.blogspot.com/2008/10/better-execadmsvcjobs-stsadm-command.html

AFAICS he doesnt address the fact that a deployment could occur during deployment though.

About the PowerShell solution: while it sounds attractive, it could become complex quite fast (we have created a deployment solution in PowerShell and trust me it was no picknick). Also alot of the logic regarding deployment are internal classes (such as SPTimerStore). It is definately doable, though :-)

Licensed under: CC-BY-SA with attribution
Not affiliated with sharepoint.stackexchange
scroll top