|
|
|
Waaay too late to the party, my friend ...
1) Anything Linq related is going to be slower...
2) Linq2Sql is dead... I don't believe MSFT is developing it any further, they are focusing on Entity Framework.
Plenty of ORM frameworks to choose from. Linq2Sql is NOT a good pick. EF, nHibernate, etc. are better choices.
|
|
|
|
|
Linq2Sql is dead indeed, but it has been completed. Theres nothing to be done more. So I cannot consider this as a disadvantage.
EF is much more complex and difficult to use. It also has lots of bugs. Linq2Sql is a perfect choice for smaller applications. What about larger apps? EF is also quite slow. In some scenarios ADO.NET could just be better choice.
NHibernate? It almost doesnt have any sensible documentation, tutorials, showhows. It is the worst possible choice in my opinion.
|
|
|
|
|
It's all rubbish. Roll your own so you know what it's doing.
|
|
|
|
|
Haha. And all this time I was thinking it was the latest and greatest. Oh well, I will definitely look into alternatives, as mentioned. Thanks! :P
djj55: Nice but may have a permission problem
Pete O'Hanlon: He has my permission to run it.
|
|
|
|
|
Although Entity Framework has replaced Linq2Sql in Microsoft's technology stack, the philosophy behind the APIs remains the same. Whatever you've learned about Linq2Sql will help you in EF.
My observation is that ORMs are a lot more flexible on the data query side than on the data manipulation side. I tried Hibernate/nHibernate, Linq2Sql and EF, and in all cases the data retrieval was impeccable. Writing data back, however, was a different story: all frameworks are great when you modify your data in memory and then write it back, but you must jump through the hoops to implement mass inserts (e.g. table-to-table copies), updates, or deletes. Here is a good link that explains the issue and provides a work-around for Linq2Sql[^]. Good luck!
|
|
|
|
|
LINQ to SQL isn't "dead" dead, it is still being supported (and looks likely to remain so for a while) but no new features are being added. Microsoft is focusing on the Enitiy Framework, so that is worth a squizz and having used LINQ to SQL will help you
It is worth looking at the ADO stuff directly, but only so:
a) You understand the underlying technologies
b) You realise exactly how much the various LINQ database stuff is giving you.
Straight ADO was an (u)necessary pain. It is needed to get the data in and out (and therefore necessary). But then you had to work with the results sets, and they didn't play well in OO land.[^] so you had to write your own ORM or live with the fact you were working with relation data and forego a proper object model, without built-in support this was un unecessary pain.
|
|
|
|
|
I have a service written in C# that keeps exiting without any error message.
The only clue I have to the problem is that the thread exit code is FF .
Do you have any suggestions about how I can debug this?
---------------------------------------------------------
I have a lot of intertwined dependencies in this solution, and it turns out that some assemblies were using older builds of common assemblies than others. DUH!
Thanks for everyone's help on this matter.
The difficult we do right away...
...the impossible takes slightly longer.
modified on Friday, July 15, 2011 2:40 PM
|
|
|
|
|
Check the system event log.
Put a try/catch around the main processing loop and see if anything falls out.
Set an Application.UnhandledExceptionHandler (not sure if Application is available in services though).
|
|
|
|
|
Thank you. Those are great suggestions.
The difficult we do right away...
...the impossible takes slightly longer.
|
|
|
|
|
Debug - > Attach To Process
Also, log files are good.
|
|
|
|
|
I've tried that, and Visual Studio does not catch any exception at all.
It simply says, "XXXX Thread exited with code 0", "Process XXX has exited with code FF".
The difficult we do right away...
...the impossible takes slightly longer.
|
|
|
|
|
I've used something like the following in my OnStart methods:
# if DEBUG
System.Threading.Thread.Sleep ( OneMinute ) ;
# endif
Which gave me enough time to attach the debugger after telling the Service to start.
|
|
|
|
|
Thank you, but Visual Studio does not catch any exception. The process simply quits. I have disabled the hosting process, but this made no difference.
The difficult we do right away...
...the impossible takes slightly longer.
|
|
|
|
|
Can you show us your
OnStart code?
|
|
|
|
|
Hi Shameel. The code is below, however the service quits as a response to a different service interacting with it through remoting. In other words, it starts up OK.
protected override void OnStart(string[] args)
{
try
{
RemotingConfiguration.Configure("Poller.dll.config", false);
}
catch (Exception ex)
{
StreamWriter Fs = new StreamWriter("PollStationError.log");
Fs.WriteLine(ex.ToString());
Fs.Close();
}
}
The difficult we do right away...
...the impossible takes slightly longer.
|
|
|
|
|
Is something logged to your log file? I mean, does it throw any exception?
|
|
|
|
|
Unfortunately, no.
HOWEVER, I just discovered an Access Violation in the Application Event logs. It comes from the .NET runtime.
It gives the address of the violation, but that's the address that was "accessed," not the address of the code that caused the violation. Hmm.
The difficult we do right away...
...the impossible takes slightly longer.
|
|
|
|
|
Comment your call to RemotingConfiguration.Configure() method and write a simple event log entry just to make sure that RemotingConfiguration.Configure() is not the problem.
|
|
|
|
|
If this is all the code you have in your OnStart, it's no surprise that your service starts, then dies. You don't have any kind of worker thread running that does the actual work or listens for connections. You service isn't starting anything up that does anything.
|
|
|
|
|
Not true. The work is done by threads that are started by remoting calls to this singleton object.
In other words, a client calls the "Start" function in this object, and that begins the work.
The "OnStart" routine you see is merely like a constructor.
The difficult we do right away...
...the impossible takes slightly longer.
|
|
|
|
|
Post the config file, 'cause, from your description, something's fishy.
|
|
|
|
|
Can anyone help me convert this registry key into readable values?
http://img714.imageshack.us/img714/7929/regbinary1.jpg
into readable values? For some reason I can pull the registry key as a char[], but it ignores "4F 16 AB C1 4F
The other values convert to "System Byte []" , I'm not sure what the logic is behind the way these are setup?
Thanks for reading!
modified on Wednesday, July 20, 2011 1:29 PM
|
|
|
|
|
1. Your link is wrong.
2. It does not have a "readable value", it's obviously some form of binary value used by the application that set it up in the first place.
3. A better post would be to explain why you want to interpret this, and what problem you are trying to solve.
The best things in life are not things.
|
|
|
|