WriteLock exception on ReadProject RRS feed

  • Question

  • I have multiple processes working on a project on Project Server 2010.  Some of the processes are updating a project (using queuing) while others are reading data.  Oddly the ones reading data periodically generate an exception "ProjectHasWriteLock" on a ReadProject() call.  I am guessing that the updating process is writing to the database when the ReadProject tries to read volatile info from the db.  Fair enough!  But, how do I delay the read until the data is stable?  Is there a way to detect the lock before I try and do the ReadProject?

    Friday, January 14, 2011 4:10 PM

All replies

  • I never got an answer on this.  So...

    I wrote a new version of ReadProject() that sleeps its thread for 1 second and then retries the Microsoft ReadProject() call.  It does this a max of 10 times before failing.  This has resolved the issue, but it would seem that there should be a better solution in the API for when the system is updating the database.

    My remaining fear is that there is some other process that will run into these locks and cause an unanticipated failure.


    Friday, January 21, 2011 4:34 PM