Service side code is executing after time out.
-
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
-
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
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
-
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
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.
-
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.
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