Answered ADO.Net Data Services + Race Conditions

  • Wednesday, January 21, 2009 9:19 AM
     
     

    I'm having a hard time coming up with a good strategy for all my data access since I have to use 100% Async calls...

    Ex: I want to add a new "Video" to a database using an async Insert request. However, I before I can add this

    video I need to associate a user to it (another async call) and I need to associate a VideoType to it (another async call).

    As you can imagine, i'm running into problems where the video is trying to be added before they have been associated to the user or videotype!

    Any tips to help me out?

     

     

All Replies

  • Wednesday, January 21, 2009 10:07 AM
     
     Answered

    it seems like you can combine some of these calls.

    however, your methods can be chained through callbacks:

    method 1 callback calls method 2
    method 2 callback calls method 3

    and so on...

     

  • Wednesday, January 21, 2009 11:07 AM
     
     

    Thanks, googling this has provided me some examples to study.

    EDIT:  I would also be interested to see examples of this using lambdas?

  • Wednesday, January 21, 2009 8:28 PM
     
     

    This might be an option as well

     "Synchronous Web Service Calls with Silverlight 2: Dispelling the async-only myth"

     http://www.codeproject.com/KB/silverlight/SynchronousSilverlight.aspx

  • Thursday, January 22, 2009 8:18 AM
     
     

     you're not doing anyone a favor by suggesting hacked and shoddy programming practices.