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. General Programming
  3. WCF and WF
  4. Service side code is executing after time out.

Service side code is executing after time out.

Scheduled Pinned Locked Moved WCF and WF
wcfquestioncsharpdatabasewpf
4 Posts 3 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.
  • L Offline
    L Offline
    Lijo Rajan
    wrote on last edited by
    #1

    Hi All, I am using IsOne way and nettcp binding in my WCF. [ServiceBehavior(InstanceContextMode = InstanceContextMode.Single,ConcurrencyMode=ConcurrencyMode.Multiple)] public class FlexiAsyncServer : IAsyncInterface { public void OneWayRequest() { for (int i = 0; i <= 5000; i++) { DbCommand cmd = dbAsync.GetSqlStringCommand("insert into JOB_DEFNN (JOB_NM,JOB_STAT_CATG_ID,JOB_GRP_ID) values('"+i.ToString()+"',1,101)"); dbAsync.ExecuteNonQuery(cmd); } } } In Service side before inserting this 5000 records into database i am getting time out error in client side. But though i got error the records are being inserted until it complets 5000. My question is why the service side execution is not stopping after throwing time out error? Can any one clarify my doubt please? Thanks Lijo

    R 1 Reply Last reply
    0
    • L Lijo Rajan

      Hi All, I am using IsOne way and nettcp binding in my WCF. [ServiceBehavior(InstanceContextMode = InstanceContextMode.Single,ConcurrencyMode=ConcurrencyMode.Multiple)] public class FlexiAsyncServer : IAsyncInterface { public void OneWayRequest() { for (int i = 0; i <= 5000; i++) { DbCommand cmd = dbAsync.GetSqlStringCommand("insert into JOB_DEFNN (JOB_NM,JOB_STAT_CATG_ID,JOB_GRP_ID) values('"+i.ToString()+"',1,101)"); dbAsync.ExecuteNonQuery(cmd); } } } In Service side before inserting this 5000 records into database i am getting time out error in client side. But though i got error the records are being inserted until it complets 5000. My question is why the service side execution is not stopping after throwing time out error? Can any one clarify my doubt please? Thanks Lijo

      R Offline
      R Offline
      rt2800
      wrote on last edited by
      #2

      The timeout is related to WCF network connection. The server side method seems to be taking much longer to complete, meanwhile network connection timeout occurs. for example, you can Increase WCF timeout as follows #If DEBUG Then //make time for debugging (stepping) code channelBinding.SendTimeout = New TimeSpan(0, 15, 0) channelBinding.CloseTimeout = New TimeSpan(0, 15, 0) channelBinding.OpenTimeout = New TimeSpan(0, 15, 0) channelBinding.ReceiveTimeout = New TimeSpan(0, 15, 0) #End If

      L 1 Reply Last reply
      0
      • R rt2800

        The timeout is related to WCF network connection. The server side method seems to be taking much longer to complete, meanwhile network connection timeout occurs. for example, you can Increase WCF timeout as follows #If DEBUG Then //make time for debugging (stepping) code channelBinding.SendTimeout = New TimeSpan(0, 15, 0) channelBinding.CloseTimeout = New TimeSpan(0, 15, 0) channelBinding.OpenTimeout = New TimeSpan(0, 15, 0) channelBinding.ReceiveTimeout = New TimeSpan(0, 15, 0) #End If

        L Offline
        L Offline
        Lijo Rajan
        wrote on last edited by
        #3

        Hi, Thanks a lot for your reply. My question is not that. My question is why service side code is continuing execution after time out happend? Thanks Lijo.

        N 1 Reply Last reply
        0
        • L Lijo Rajan

          Hi, Thanks a lot for your reply. My question is not that. My question is why service side code is continuing execution after time out happend? Thanks Lijo.

          N Offline
          N Offline
          nlarson11
          wrote on last edited by
          #4

          The front-end and the server-end are to completely different processes. The front-end times out (stops waiting for a response) but the server-end does not know that and continues to process the request. When it replies...there is nothing waiting for the response so the response just goes into limbo. There is a flag in asp.net "IsClientConnected" which tested whether or not there was still something waiting for the response. So in the loop, you would check that and if it was false, you'd get out because no on wanted the result any longer. I do not know if WCF has something simular.

          'Never argue with an idiot; they'll drag you down to their level and beat you with experience.' ~ anonymous 'Life's real failure is when you do not realize how close you were to success when you gave up.' ~ anonymous

          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