Hi All, I am using Table value parameter for bulk insert in my database. So it will be rolling back all the changes even if atleast one row fails. Is there any way that i can find out which row is failed? i hope u are able to understand my question. Can any one help me on this? Thanks Lijo
Lijo Rajan
Posts
-
Row by row error handling in Table value parameter in SQL 2008 -
Yahoo. Google Oauth APIs..Hi All, I am using Yahoo,google oauth APIs in my application. I have implimented it successfully in my local machine. It is going to our production soon. So can any one please tell me, will these APIs cause any performance or security impact on my website. Because my site is an e commerce site where we are giving much importance for security and performance. If so what are all the precautions i need to take before it goes to the production. It would be really helpfull for me if anyone can give me some idea on this since this is the first time i am working on these APIs. Thanks Lijo.
-
Service side code is executing after time out.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.
-
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
-
Duplex Call Back IssueHi All, I am implimenting Duplex CallBack Contract for my Service. I am giving my Callback Interface Below. public interface IAsyncCallbackInterface { [OperationContract(IsOneWay = true)] void GetTheCurrentChannel(DuplexChannelFactory<IAsyncInterface> factory); } So when i am trying to open the host i am getting following error Type 'System.ServiceModel.DuplexChannelFactory`1[IAsyncInterface]' cannot be serialized. Consider marking it with the DataContractAttribute attribute, and marking all of its members you want serialized with the DataMemberAttribute attribute. See the Microsoft .NET Framework documentation for other supported types. Here the IAsyncInterface is my ServiceContract. Since it is an interface how can i mark it as DataContract? Can any one plse tell me what is the issue here? Thanks Lijo
-
Threads in WCF.Thanks a lot for your reply. ok Thats fine. I can start it up again. But what will happen to the actual thread? I set Concurrency mode as mulitiple and max concurrent call is 100. So at a time this service will handle 100 requests right? For example if the 25th request is taking more time than i set in my database i need to kill that thread which is handling that 25th request. Is there any way to do this? i think you are able to understand my issue.. As per your suggestion if i start that 25th request again what will happen to the actual thread which handled that 25th request? Could you please clarify this? Thanks Lijo.
-
Threads in WCF.Hi All, I have a WCF serivce which will be called by many clients at the same time. So i set concurrency mode as multiple. So its working fine. In my database i have set time limit for processing each request. So if a particular request is not executing with in that time limit i need to kill(abort) that thread and that request should be given to a new thread. Can any one give me an idea on this that how can i do this? Thanks Lijo.
-
Threads in WCF..Hi All, In my service i set the concurrency mode=multiple because my service should handle muliple request. My question is what will happen to the thread if something goes worng on a particular request which is handling by that thread? Does WCF abort this thread? or do i need to write code to abort that particular thread? Thanks Lijo.
-
How to open multiple service host for same address,binding contract?Hi, Thanks a lot for your reply. I will clearly explain my scenario. I have a single Service Contract. And this Interface will be implemented in different classes. Because in each class the implimentation will be different.So for opening the service host i need to provide the type of these classes. That i will come to know ony at run time. I am getting that type information from database. So each time when loop comes in the type will be diffrent.In that case how i can do it? because i will be getting multiple types from database.thats why i put it in loop. Can u please suggest me a better way to do this? Thanks Lijo
-
How to open multiple service host for same address,binding contract?Hi All, I am giving my code below. for (int i = 0; i <= 50; i++) { ServiceHost host=new ServiceHost(); host.AddServiceEndpoint(contract, binding,"net.tcp://16.69.13.55:1000/"); host.Open(); ChannelFactory<IAsyncInterface> factory; factory = new ChannelFactory<IAsyncInterface>(binding, fullBaseAddress); iAsync = factory.CreateChannel(); ((IContextChannel)iAsync).OperationTimeout = new TimeSpan(00, 10, 00); iAsync.BeginNew(i.ToString(), new AsyncCallback(OnEndGetNew), null); } i am calling WCF service asynchronously. first time its opening host properly.but when it tries to open second time i am getting error like this. "The ChannelDispatcher at 'net.tcp://16.69.13.55:1000/FlexiAsyncServer' with contract(s) '"IAsyncInterface"' is unable to open its IChannelListener.". can any one please tell me how to solve this issue? or is there any other way to do this? Thanks Lijo.
-
Not able to generate the Proxy for WCFHi All, I am using below mentioned code for opening the Host for my WCF Service. Type contract = config.GetServiceContractType("IAsyncInterface"); Binding binding = config.CreateBinding(); string fullBaseAddress = string.Concat(BASE_ADDRESS, type.Name); WCFServiceHost host = new WCFServiceHost(config, type, new Uri(fullBaseAddress)); host.AddServiceEndpoint(contract, binding, ""); ServiceMetadataBehavior metaDataBehavior = new ServiceMetadataBehavior(); metaDataBehavior.HttpGetEnabled = false; host.Description.Behaviors.Add(metaDataBehavior); host.AddServiceEndpoint(typeof(IMetadataExchange), binding, "MEX"); host.Open(); its opening host properly. but when i try to generate the proxy i am getting error like "metadata contains a reference that cannot be resolved net.tcp" Can any one give me a solution for this? Thanks Lijo.
-
Checking WCF Service has Free Thread or not..Can any one please give me an idea on this?
-
Checking WCF Service has Free Thread or not..Hi All, How can i check my service has free thread or not? At the time of client request to service i need to check whether service has enough free threads to handle client's request. How can i do that? Thanks Lijo.
-
Reading File From Network drivemy file resides in remote system. from that system only i want to read a file. can you please tell me how can i do that? Regards Lijo
-
Reading File From Network driveHi all, can any one please tell me how can i read from a file which resides in net work drive? Regards Lijo
-
Valid Reason for Using IDisposable intrefaceI think u guys did not understand my question. i very well know tat we have to use IDisposable intreface for handiling un managed resources. but we no need to inherit our class from IDisposable intreface for implimenting Dispose method. I can write my own Dispose method. So my question is what is the specific reason behind inheriting our class from IDisposable intreface?
-
Valid Reason for Using IDisposable intrefaceThats fine. There is nothing relevant in my code. Code i have given just for explaining my Problem. So Can u please tell me why should i inherit my class from IDisposable intreface for implementing dispose method? Here i can write my own Dispose method without inheriting IDisposable intreface which i have shown in my code. Then can u please tell me why microsoft is telling that i have to inherit my class from IDisposable intreface for implimenting dispose method? is there any specific reason behind that? in my code directly i used img.Dispose();. here i no need to inherit my class from IDisposable intreface. I think u can understand what i am trying to clarify.. Regards Lijo
-
Valid Reason for Using IDisposable intrefaceHi All, Can anyone please clarify my dout about IDisposable intreface in C#. We all know tat IDisposable interface is using for disposing unmanaged resources. I have a class which contains following code. here i have implimented the Dispose method from IDisposable interface. class ClassA:IDisposable { public ClassA() { Console.WriteLine("ClassBeingTested: Constructor"); } private bool disposed = false; Image img = null; public Image Image { get { return img; } } ~ClassA() { Console.WriteLine("ClassBeingTested: Destructor"); // call Dispose with false. Since we're in the // destructor call, the managed resources will be // disposed of anyways. Dispose(false); } public void Dispose() { Console.WriteLine("ClassBeingTested: Dispose"); // dispose of the managed and unmanaged resources Dispose(true); // tell the GC that the Finalize process no longer needs // to be run for this object. GC.SuppressFinalize(this); } protected virtual void Dispose(bool disposeManagedResources) { // process only if mananged and unmanaged resources have // not been disposed of. if (!this.disposed) { Console.WriteLine("ClassBeingTested: Resources not disposed"); if (disposeManagedResources) { Console.WriteLine("ClassBeingTested: Disposing managed resources"); // dispose managed resources if (img != null) { img.Dispose(); img = null; } } // dispose unmanaged resources Console.WriteLine("ClassBeingTested: Disposing unmanaged resouces"); disposed = true; } else { Console.WriteLine("ClassBeingTested: Resources already disposed"); } } // loading an image public void LoadImage(string file) { Console.WriteLine("ClassBeingTested: LoadImage"); img = Image.FromFile(file); } } What my doubt is why i need to impliment the Dispose method from IDisposable interface?. Instead of that i can create my own Dispose method in my class without inheriting from IDisposable interface which i have given below. for the class below i haven't inherited my class from IDisposable interface. instead of that i created my own dispose method. this also works fine. class ClassA { public ClassA() { Console.WriteLine("ClassBeingTested: Constructor"); } private bool disposed = false; Image img = null; public Image Image { get { return img; } } ~ClassA() { Console.WriteLine("ClassBeingTested: Destructor"); // call Dispose with false. Since we're in the // destructor call, the managed resources will be // disposed of anyways. Dispose(false); } pub
-
Why do we need to serialize data?Hi all, Can any one plse tell me the exact use of serialization? in which scenario we can use it? Regards Lijo
-
Is it possible to get the value of previous page view state value in current page?Hi all, Can u tell me Is it possible to get the value of previous page view state value in current page? eg page1 viewstate["Name"]="Akash" response.redirect("page2.aspx") so in Page2 how can i get the value of viewstate["Name"]? is it possible? if so how? Thanks and Regards Lijo