This thread looks to be a little on the old side and therefore may no longer be relevant. Please see if there is a newer thread on the subject and ensure you're using the most recent build of any software if your question regards a particular product.
This thread has been locked and is no longer accepting new posts, if you have a question regarding this topic please email us at support@mindscape.co.nz
|
Hi - I am using C# with VS 2013 on Windows 7. I am running LS 5, nightly build from 8/24/2014 (yeah, I know I should update but...). We have a situation where one of our offices is in the UK and the main CRM database (Oracle) is in the middle of the USA. During a typical day in production the testing server needs to get information from the main database numerous times, and has a tendency to time out occasionally. I have a WCF service and SQL database running locally, so the SQL calls aren't typically a big deal, but the Oracle calls are a bit of a pain. I would like to wrap every call to the Oracle database so that it retries a specified number of times before throwing an exception back to the caller. However, the following code is ugly and I don't feel like sprinkling ugliness throughout my beautiful code:
I would much rather do something like this:
Is this even possible? If so, why has it not been implemented before? Is it just a really bad idea or what? If it sounds like a decent idea, can you give me a few pointers on how to accomplish it? That would be super awesome!! Thanks, Dave |
|
|
Hi Dave, It may be worth looking at Polly - https://github.com/michael-wolfenden/Polly - also see Hanselman's post on it http://www.hanselman.com/blog/NuGetPackageOfTheWeekPollyWannaFluentlyExpressTransientExceptionHandlingPoliciesInNET.aspx You should be able to do stuff like this (Note : This is just me typing code, not sure if this would actually work as is!)...
Hope it helps, Cheers, Sean |
|
|
Thanks for the tips and links! I think it will work, even though it isn't quite as integrated into the Fluent chain as I hoped it could be. It sill cleans things up a lot, and that's what I was after. And, I don't have to write it from scratch! Yay! |
|
|
Hey guys - We purchased LightSpeed several years ago based on how much easier it was to implement and how much more feature rich it was than EF at the time. Since then EF has made major strides and is now about as easy to use as LS and has comparable features while nearly every change made to LS in the last couple of years has been limited to bug fixes and such. So the question has come up "around the water cooler" why we are still paying for Lightspeed. So far, sheer speed and the fact we would have to rewrite a ton of code to implement EF have carried the day for you guys. However... In digging around looking for examples of people implementing the Polly package mentioned above, I found this little gem (from http://blog.jaywayco.co.uk/circuit-breaking-with-polly/): "These considerations aside, this kind of resilience is very important to a platform of any size. So much so that Microsoft has started building in retry policies into some of its core components. An example is EF6 has made it very easy to implement a retry policy. In the modern world of cloud services and micro-services this kind of resilience is probably more important than ever." I have not explored this feature of EF, but it seems the development of new features has pretty much stalled since you started working on your own cloud services (Raygun.io comes to mind). Here you have an area where the folks at MS seem to be forging ahead with new features that you all haven't paid much attention to. For example, I didn't even get a response to this question from a Mindscape staff member. So I guess my real question is: Why have you seemingly abandoned continued development and improvement of Lightspeed? Can I count on you to continue to be the best, fastest, most well-supported ORM in the world or should we consider moving to EF so we can save the annual support costs? Awaiting a response from a Mindscape staff member... Dave |
|
|
Hi Dave, We haven't abandoned improvement of LightSpeed at all, we are regularly pushing out bug fixes and small improvements based on support requests and this forum - it eats quite a lot of my time :) We also obviously use LightSpeed ourselves every day in our own products (e.g. Raygun). LightSpeed is very mature product now though and we have generally achieved what we wanted to when we set out to build it, it does what it says on the tin and it does it well. I hear what you are saying about adding in retry support and the like but this is not something we are looking to build in to the product. Its always been an opinionated framework and we don't believe that it fits, in general we have tried to avoid putting too much into LightSpeed as everything comes at a cost and high performance has always been one of our primary goals for the product. You can obviously still cater for this yourself if need be and I think thats a pretty good balance. In terms of EF, thats really something you need to weigh up - if you like the features it is offering, are happy with how it performs and are happy to continue upgrading along its path whatever the implications then it may be a more appropriate solution for you.
|
|