2009/11/05
SQL Server 2008 R2 Running on “Big Iron”
Posted by
paul
PASS Summit info on SQL 2008 running on my dream Server (192 cores). Summed up by Glenn Berry.
2009/08/17
With FAIL
Posted by
paul
If you've had the pleasure of working in VB.Net (kill self). If your lazy like me. You've probably used a WITH statement to shorthand calls to properties and methods.
For those who haven't, a WITH statement can be implemented as below:
Simple enough, right. Now enter Linq...
Linq queries (Linq2SQL, Linq2nHibernate, Linq2XML) add a great deal of functions to items derived from IEnumereable (Querayable objects, Lists, etc). The main method I was using on my project was the .Where() extension method.
I'll just mention that I prefer the Extension method/Lambda syntax in C# over that of vb. Primarily because I am lazy and "=>" is two keystrokes versus "Function(x)". Now here is where my laziness caught up with me.
I was implementing a simple search function that would take in a search criteria class. The class had a few properties and a list. The properties mapped to various fields on a customer class the list maps to a view that I've associated as a child class to the customer class in my dbml. All criteria are optional on the search to allow for insanely as hoc querying.
So as I enter the .Search(criteria As SearchCriteria) method I tossed in a With statement (due to the laziness). Basically as follows:
So I step through debugging on this method and I see that the .Where's are filtering down the results as I'd expect. However when I leave the sub, a NullReferenceException is thrown from the internals of Linq2SQL... FAIL.
Thinking I may have screwed up something with the .Where's, even though a watch shows that it's good, I switch up how I do the where to
results = From r In results Where r.Id = .CustomerId
I step through, expand the watch, and it looks good. Continue running to end of method... FAIL. Again a NRE from the internals of Linq2SQL.
After cursing at length, dumping all the objects out of my dbml and re-creating. Still FAIL. Then it dawns on me. Linq2SQL queries, like all Linq queries don't execute when most people would expect. This is a good thing. You can append numerous Where statements, Orders, etc and the you don't have a call to the database until you actually go to retrieve a value (a ToList() or ToArray() will cause this as will binding the list to a webform object). Of course when I expand the watch on results it executed the underlying queries. So where did the phantom NRE come from?
Apparently, using a With statement does some kind of voodoo with memory addressing. So my .CustomerId is not the same as criteria.CustomerID. When the results were returned, we were outside the With so the framework had no idea where these .Whatevers were coming from. *sigh* So much for being lazy.
I remove the With statement and everything just works... Kill Self. That is about a day of writing, cursing, rewriting, cursing, smoking, re-rewriting, cursing that I won't get back. So that is my tale of shame, I am not proud.
For those who haven't, a WITH statement can be implemented as below:
With myObject = New SomeObject()
.Property1 = "foo"
.Property2 = "bar"
.Execute()
End With
Simple enough, right. Now enter Linq...
Linq queries (Linq2SQL, Linq2nHibernate, Linq2XML) add a great deal of functions to items derived from IEnumereable (Querayable objects, Lists, etc). The main method I was using on my project was the .Where() extension method.
I'll just mention that I prefer the Extension method/Lambda syntax in C# over that of vb. Primarily because I am lazy and "=>" is two keystrokes versus "Function(x)". Now here is where my laziness caught up with me.
I was implementing a simple search function that would take in a search criteria class. The class had a few properties and a list. The properties mapped to various fields on a customer class the list maps to a view that I've associated as a child class to the customer class in my dbml. All criteria are optional on the search to allow for insanely as hoc querying.
So as I enter the .Search(criteria As SearchCriteria) method I tossed in a With statement (due to the laziness). Basically as follows:
Public Function Search(criteria As SearchCriteria) As List(Of Customer)
With criteria
Dim results = Repository(Of Customer).GetTable()
If Not(String.IsNullOrEmpty(.Name)) Then
results = results.Where(Function(r) r.Name.Contains(.Name))
End If
If (.CustomerId IsNot Nothing) Then
results = results.Where(Function(r) r.Id = .CustomerId)
End If
...Continue a dozen more times ...
End With
Return results
End Sub
So I step through debugging on this method and I see that the .Where's are filtering down the results as I'd expect. However when I leave the sub, a NullReferenceException is thrown from the internals of Linq2SQL... FAIL.
Thinking I may have screwed up something with the .Where's, even though a watch shows that it's good, I switch up how I do the where to
results = From r In results Where r.Id = .CustomerId
I step through, expand the watch, and it looks good. Continue running to end of method... FAIL. Again a NRE from the internals of Linq2SQL.
After cursing at length, dumping all the objects out of my dbml and re-creating. Still FAIL. Then it dawns on me. Linq2SQL queries, like all Linq queries don't execute when most people would expect. This is a good thing. You can append numerous Where statements, Orders, etc and the you don't have a call to the database until you actually go to retrieve a value (a ToList() or ToArray() will cause this as will binding the list to a webform object). Of course when I expand the watch on results it executed the underlying queries. So where did the phantom NRE come from?
Apparently, using a With statement does some kind of voodoo with memory addressing. So my .CustomerId is not the same as criteria.CustomerID. When the results were returned, we were outside the With so the framework had no idea where these .Whatevers were coming from. *sigh* So much for being lazy.
I remove the With statement and everything just works... Kill Self. That is about a day of writing, cursing, rewriting, cursing, smoking, re-rewriting, cursing that I won't get back. So that is my tale of shame, I am not proud.
2009/07/23
From Tables to Objects
Posted by
paul
Jeremiah Peschka had a great ORM presentation at CONDG tonight and has uploaded incase you missed anything.
2009/07/09
Brent Ozar - What I want vs what I can afford
Posted by
paul
Brent Ozar follows up his top 10 questions for Senior DBAs with an explaination of why he isn't able to fill positions with Paul Randal.
Brent Ozar - 10 questions to ask senior DBAs
Posted by
paul
Brent Ozar goes through his top 10 questions for Senior DBAs.
2009/07/07
Twikini for Windows Mobile
Posted by
paul
Trinket Software has released version 1.1 of Twikini. I've run a few of the beta versions of Twikini with only one issue (requiring hard reset) that was resolved in the next version.
Twikini is a pretty outstanding bit of software for your Windows Mobile device. It has a much sexier UI than my other favorite client, TinyTwitter. It also runs noticeably faster. The UI is more intuitive than Pocketwit.
For most of my Tweeting needs, Twikini more than fits. I still use TinyTwitter for viewing individual timelines but since Twitter has been ignoring the #fixreplies, I see my usage of TinyTwitter falling and Twikini filling that void.
So take a look at that sweet UI and head over to http://www.trinketsoftware.com/Twikini and get a demo version to kick the tires.
Twikini is a pretty outstanding bit of software for your Windows Mobile device. It has a much sexier UI than my other favorite client, TinyTwitter. It also runs noticeably faster. The UI is more intuitive than Pocketwit.
For most of my Tweeting needs, Twikini more than fits. I still use TinyTwitter for viewing individual timelines but since Twitter has been ignoring the #fixreplies, I see my usage of TinyTwitter falling and Twikini filling that void.
So take a look at that sweet UI and head over to http://www.trinketsoftware.com/Twikini and get a demo version to kick the tires.

2009/01/13
Open letter of recommendation: Arnulfo Wing
Posted by
paul
A good friend and a wonderful colleague of mine, Arnulfo Wing. Has found himself in the position of looking for new opportunities. I have worked with Arnulfo for about a year through Quick Solutions and for many months on my current project. Arnulfo has many characteristics that made him a valuable addition to the project. He was the BizTalk resource for a fairly complex rules implementation. The project of moving the rules out of BizTalk and into something the client felt more comfortable managing was no easy task. It took about 7 months and had up to 4 developers working on the C#-based solution.
Through our many conversations, Arnulfo showed his depth of knowledge of the system. Both within BizTalk and the application that BizTalk supported. He also showed a great desire to help others understand what many look to as a "black box". He was instrumental in extracting the rules, orchestrations, literally every piece of information pertinent to the project out of the BizTalk instances so that development wouldn't have to start on the new rules engine with a blank slate.
Arnulfo also showed genuine interest in what was happening in other parts of the solution. Though BizTalk was his primary responsibility, he was available to assist in troubleshooting, design questions, and ensuring delivery.
Arnulfo has a thirst for knowledge of new technologies and methodologies. I've seen him at many area user groups. Talked to him about local conferences. He is more than "Just BizTalk". Given his ability to grok very complex systems, his excellent people skills, his depth and breath of knowledge, and his client-facing demeanor, I can see Arnulfo being able to fill many positions. These include Developer, Team Lead, and Architect.
Arnulfo's blog is available at http://arnulfowing.blogspot.com/. There you can see some of the experience he has accumulated from Hyper V corrupt drives to setting TFS to run on multiple servers... and of course, there's BizTalk.
Through our many conversations, Arnulfo showed his depth of knowledge of the system. Both within BizTalk and the application that BizTalk supported. He also showed a great desire to help others understand what many look to as a "black box". He was instrumental in extracting the rules, orchestrations, literally every piece of information pertinent to the project out of the BizTalk instances so that development wouldn't have to start on the new rules engine with a blank slate.
Arnulfo also showed genuine interest in what was happening in other parts of the solution. Though BizTalk was his primary responsibility, he was available to assist in troubleshooting, design questions, and ensuring delivery.
Arnulfo has a thirst for knowledge of new technologies and methodologies. I've seen him at many area user groups. Talked to him about local conferences. He is more than "Just BizTalk". Given his ability to grok very complex systems, his excellent people skills, his depth and breath of knowledge, and his client-facing demeanor, I can see Arnulfo being able to fill many positions. These include Developer, Team Lead, and Architect.
Arnulfo's blog is available at http://arnulfowing.blogspot.com/. There you can see some of the experience he has accumulated from Hyper V corrupt drives to setting TFS to run on multiple servers... and of course, there's BizTalk.
Subscribe to:
Posts (Atom)