none
Will a SOA Service's Dispose method be called when its allocation shrinks? RRS feed

  • Question

  • We are using the SOA model on Windows HPC Server 2008.

    For our application, we want to be able to run some cleanup code when a
    service instance exits.

    Our Service class implements the IDisposable interface, and we have found
    that when the client calls CloseSession, the Dispose method on our Service
    is called which lets us call our cleanup code.

    Our question is in the case where our service's allocation shrinks. If the
    number of service instances for our service shrinks, will the Dispose method of our
    service be called for the service instances that are shut down?

    Thanks,
    Derek
    Thursday, February 18, 2010 9:22 PM

Answers

  • What Mingqing said is that "Dispose()" is not guranteed so don't count on IDisposable in Windows HPC Server 2008. In certain cases, when services are shrinked, process will be killed directly and Dispose() won't get a chance to be called correctly.

    We are adding a new OnExit() interface in Windows HPC Server 2008 R2 to solve this problem and it should be available in future beta releases.
    Wednesday, February 24, 2010 3:52 AM

All replies

  • Hi Derek, it is not supported that Dispose method being called when service shrinks in Windows HPC Server 2008. You might need an extra job to do the cleanup work after SOA session finishes.
    Monday, February 22, 2010 7:53 AM
  • What Mingqing said is that "Dispose()" is not guranteed so don't count on IDisposable in Windows HPC Server 2008. In certain cases, when services are shrinked, process will be killed directly and Dispose() won't get a chance to be called correctly.

    We are adding a new OnExit() interface in Windows HPC Server 2008 R2 to solve this problem and it should be available in future beta releases.
    Wednesday, February 24, 2010 3:52 AM