Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. Database & SysAdmin
  3. Database
  4. Database unable to return data to all clients for 10 clients or more making same call at same time.

Database unable to return data to all clients for 10 clients or more making same call at same time.

Scheduled Pinned Locked Moved Database
helpdatabasecsharpwcfsales
4 Posts 2 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • S Offline
    S Offline
    Steve Holdorf
    wrote on last edited by
    #1

    I have been working on this one for week and I need help. It is complicated but I will try to explain what is going on and show a little code. What I have is a Silverlight application that communicates via WCF to the database. Now, the complicated part is that a windows job sends a UDP alert packet to each of the Silverlight clients to trigger an update of a DataGrid on the main page which does it update via the same WCF service Async call. This means that if I have 50 Silverlight clients when the alert packet is fired each of the 50 clients will make the same WCF call to the database. I have checked and insured that each client receives the UDP call. The problem is that when the clients all make the same call It gives me a wcf service error on some, but not all, of the clients. The code below shows the basic concept of the code in WCF service database call and Silverlight code. Of course the code is broken up into several sections, but you should get the main idea. (WCF CODE) List clist = new List(); ... _sqlcommand = new SQLCommand(); _sqlcommand = new SQLCommand(); _sqlcommand.Connection = _database.connectionString; _sqlcommand.CommandType = CommandType.StoredProcedure; _sqlcommand.CommandText=”GetCustomers”; try { Customer customer; _reader = _sqlcommand.ExecuteReader(); While (_reader.Read()) { customer = new Customer(); customer.Name = _reader[“Name”].ToString(); … … … clist.Add(customer); } } catch (exception e) { … } } return clist; (SILVERLIGHT CODE) observableCollection obsCollection = new observableCollection(); private getmethod() { current.client.GetCustomerServiceCompleted += new EventHandler(ServiceReference.GetCustomerServiceCompleteEventArgs(client_GetCustomerServiceCompleted); current.client.GetCustomerServiceAsync(); } void client_GetCustomerServiceCompleted (sender, ServiceReference. GetCustomerServiceCompleteEventArgs e) { obsCollection = e.Results; this.CustomerGrid.ItemsSource = obsCollection; } Thank you very much! Steve Holdorf

    L 1 Reply Last reply
    0
    • S Steve Holdorf

      I have been working on this one for week and I need help. It is complicated but I will try to explain what is going on and show a little code. What I have is a Silverlight application that communicates via WCF to the database. Now, the complicated part is that a windows job sends a UDP alert packet to each of the Silverlight clients to trigger an update of a DataGrid on the main page which does it update via the same WCF service Async call. This means that if I have 50 Silverlight clients when the alert packet is fired each of the 50 clients will make the same WCF call to the database. I have checked and insured that each client receives the UDP call. The problem is that when the clients all make the same call It gives me a wcf service error on some, but not all, of the clients. The code below shows the basic concept of the code in WCF service database call and Silverlight code. Of course the code is broken up into several sections, but you should get the main idea. (WCF CODE) List clist = new List(); ... _sqlcommand = new SQLCommand(); _sqlcommand = new SQLCommand(); _sqlcommand.Connection = _database.connectionString; _sqlcommand.CommandType = CommandType.StoredProcedure; _sqlcommand.CommandText=”GetCustomers”; try { Customer customer; _reader = _sqlcommand.ExecuteReader(); While (_reader.Read()) { customer = new Customer(); customer.Name = _reader[“Name”].ToString(); … … … clist.Add(customer); } } catch (exception e) { … } } return clist; (SILVERLIGHT CODE) observableCollection obsCollection = new observableCollection(); private getmethod() { current.client.GetCustomerServiceCompleted += new EventHandler(ServiceReference.GetCustomerServiceCompleteEventArgs(client_GetCustomerServiceCompleted); current.client.GetCustomerServiceAsync(); } void client_GetCustomerServiceCompleted (sender, ServiceReference. GetCustomerServiceCompleteEventArgs e) { obsCollection = e.Results; this.CustomerGrid.ItemsSource = obsCollection; } Thank you very much! Steve Holdorf

      L Offline
      L Offline
      Lost User
      wrote on last edited by
      #2

      Just a suggestion. If you're using Windows XP and Http Binding, XP has a limitation of 10 concurrent Http connections.

      S 1 Reply Last reply
      0
      • L Lost User

        Just a suggestion. If you're using Windows XP and Http Binding, XP has a limitation of 10 concurrent Http connections.

        S Offline
        S Offline
        Steve Holdorf
        wrote on last edited by
        #3

        Thanks for the quick response; however, we are using Windows 7 all the way around. Still not sure. My DBA used the NO LOCK for the stored procedure but still no luck. Thanks, Steve Holdorf

        S 1 Reply Last reply
        0
        • S Steve Holdorf

          Thanks for the quick response; however, we are using Windows 7 all the way around. Still not sure. My DBA used the NO LOCK for the stored procedure but still no luck. Thanks, Steve Holdorf

          S Offline
          S Offline
          Steve Holdorf
          wrote on last edited by
          #4

          To solve the problem all I did was put a using(connection = new SQLConnection ...) statment around the code using the sql connection so the unmanaged resources were garbage collected. Thanks, Steve Holdorf

          1 Reply Last reply
          0
          Reply
          • Reply as topic
          Log in to reply
          • Oldest to Newest
          • Newest to Oldest
          • Most Votes


          • Login

          • Don't have an account? Register

          • Login or register to search.
          • First post
            Last post
          0
          • Categories
          • Recent
          • Tags
          • Popular
          • World
          • Users
          • Groups