Necropolis
Executive Member
- Joined
- Feb 26, 2007
- Messages
- 8,413
- Reaction score
- 43
Its entityframework, it will manage the connection's itself within the datacontext.
This is why I prefer handling DB connections myself.
South Africa’s biggest forum. Discuss, discover, and connect with thousands of members.
Its entityframework, it will manage the connection's itself within the datacontext.
You perhaps not swallowing an exception higher up in the call stack? So while you "think" it works, it actually doesn't? Perhaps an invalid datatype attempted at saving.
This is why I prefer handling DB connections myself.
Hmm.. Lemme refresh the model and reattempt?
When I save it to the type "AfricaStuff" if there was a type issue it wouldn't compile even would it?
Lemme comb through this again.
Huh? I thought you'd never touch EF with anything.Entityframework is more than efficiently doing that. Its the person implementing the DataContext that is at fault.
Move that submit on changes out the loop as well and see if it makes a difference. Creating transaction scopes for thousands of small records is stupid.
foreach (AfricaStuff item in africaStuff )
{
dataContext.AfricaStuff.InsertOnSubmit(item);
}
dataContext.SubmitChanges();
Huh? I thought you'd never touch EF with anything.
so rather :
Code:foreach (AfricaProjectsSharePoint item in africaProjects) { dataContext.AfricaStuff.InsertOnSubmit(item); } dataContext.SubmitChanges();
Yeah, I doubt it will resolve your issue though.
Anything I do these days is without an ORM.
So rather then debugging this.. Idea's on possible alternative's that can do the same thing but aren't a WCF service?
Need to be kicked off by a SSIS package.
Get that idea out of your head, you should rather fix the issue. As it could be an underlying problem.
Get that idea out of your head, you should rather fix the issue. As it could be an underlying problem.
What exactly is the service doing?
Couldn't you package it all up in a script task within SSIS?
you make good points. You remind me of my boss. Sure I'm not on your team?
![]()
Unlikely, I don't code in C# at the moment![]()
this is a snippet code implementing it, close the connection at the end. Or is this more a question of am I closing the connection from the implementation end? :
Code:static void Main(string[] args) { ChannelFactory<IAfricaStuff> channelFactory; IAfricaStuff client; try { //create the binding var binding = new WSHttpBinding(); //configure the binding binding.Security.Mode = SecurityMode.Message; binding.MaxReceivedMessageSize = 2147483647; binding.Security.Transport.ClientCredentialType = HttpClientCredentialType.Windows; binding.SendTimeout = new TimeSpan(0, 10, 0); binding.CloseTimeout = new TimeSpan(0, 10, 0); binding.OpenTimeout = new TimeSpan(0, 10, 0); binding.ReceiveTimeout = new TimeSpan(0, 10, 0); var endpointAddress = new EndpointAddress("http://localhost:54358/AfricaStuff.svc"); channelFactory = new ChannelFactory<IAfricaStuff>(binding, endpointAddress); client = channelFactory.CreateChannel(); var result = client.SaveStuff(); //create the channel channelFactory.Close(); } catch(Exception ex) { Console.WriteLine(ex.Message); } }
Hey Dude
Just debug properly and put log msgs for each successful task and the failure.There should be no reason to redevelop and im shocked that that was put forward as a suggestion.