Category Archives: Data Access

I go away for a few days and look what I miss! EF Beta 3 was released!

After I left Seattle, rather than going home as I had planned I ended up going to my parent’s house (where I still am) to attend a funeral after which I was whisked up to Canastota NY where my mom was camped out with two pregnant dogs (Celeste and Bumper) near her fabulous vet (Village Vet in Canastota) waiting for the right time to do c-sections and bring the pups into the world. Celeste had 6 beautiful puppies yesterday and I drove them back to Binghamton and am now helping out with her pups as well as the 2 week old litter of 17. Mom and my sister are still in Canastota with Bumper and they will be doing (they = vet, not my mom & sister) doing her c-section today with an expectation of 10 or more puppies.

In the meantime, what did I miss?

We were sent the entire transcript of our conversation with Bill Gates earlier this week. Keith Peters is posting it (in sections) on his blog.

Entity Framework Beta3 and the CTP2 of the tools were released.  (Also, here’s a  list of breaking changes) I’ve only been waiting for this for months and I can’t even look at it right now because I am responsible for precious little lives.

 

 

 

Another EF Beta 3 Tidbit

I attended Zlatko Michailov’s talk on Entity SQL today at DevTeach which was definitely interesting to me. In showing Entity SQL queries, Zlatko used a tool that he built as an experiment that evaluates Entity SQL queries (with some intellisense help as you type them!), displays the resulting provider level SQL and then displays the resulting data in grids (plural if there is related data in the result). It will be cool to see that tool evolve into something that we can use…keep your eyes on his blog just in case!

While I learned a ton, one of the very interesting (amazing actually) things that Zlatko shared with us about the upcoming Beta 3 of Entity Framework is that they had done some serious work on performance in the Object Services layer and that it is almost as fast in materializing objects as the Entity Client is at streaming results. He also said that they are closing in on SQLClient performance.

Another new Program Manager on the Entity Framework team

I learned today about Diego Vega who is another new hire on the Entity Framework team. Diego is responsible for Linq to Entities. As EF grows, there are more and more specialized people on the team. So now we have Zlatko who is the Entity SQL PM, Alex who owns the Entity Data Model and Diego will be focused on LINQ to Entities.

A funny post yesterday as Diego gets “revenge” on Zlatko who wrote a post on LINQ to Entities. Diego’s revenge is to write a post about Entity SQL. And of course, we’re the beneficiaries!

Tell me why you don’t like Entity Framework

I find that people really want to tell me what’s wrong with Entity Framework. This is a good thing. It’s how I learn. It’s sometimes a little overwhelming, but since I feel like I’m just the messenger, I don’t take any of it personally.

So go ahead.

Tell me why you don’t like Entity Framework. Why you think people should stay away from it (I heard this advice was being given in a SQL Connections talk). Why you want to hit someone. Why it frightens you. Why you think it is a dba’s nightmare. Bring it on.

But only do so with the understanding that I ask only because it will help me understand Entity Framework better. 

Update:[I thought there was an ] Entity SQL difference when using ObjectQuery vs EntityClient

*Update* It turns out that I completely misunderstood Zlatko Michailov’s email reply to me when I was having trouble with this. I seem to have freaked out the team by writing this errant blog post. Sorry guys.

When using ObjectQuery, I was doing this:

Dim myAWEntities=New AdventureWorksEntities

dim myObjQuery=myAWEntities.CreateQuery(Of Customer)(“SELECT VALUE cust from myAWEntities.Customer as cust “)

I was thinking in LINQ, using the variable of the instance I had created.

But if I use the entitySet name, it’s fine.

“SELECT VALUE cust from AWEntities.Customer as cust ” &

I am having a really hard time believing that I didn’t try that since I was trying a lot of things, but it is now working and I’m still on Beta2.

I went around in circles with this one a few weeks ago (preparing for a session at DevConnections) and saw that someone had the same problem on the forums yesterday so thought I would blog it.

I have no idea if it will change going forward, but this is in E.F. Beta 2.

Entity SQL is the query language that you use when

1. querying through ObjectServices directly by creating an ObjectQuery as in

Dim MyObjQuery=MyObjectContext.CreateQuery(Of MyEntityClassType)(myEntitySQLQueryString).

or 2. querying through the Provider: EntityClient

Dim myCommand=New EntityCommand(myEntitySqlQueryString,myEntityConnection)Dim myDataReader=myCommand.ExecuteReader(COmmandBehavior.SequentialAccess)

A simplistic EntitySQL query looks something like this:

“Select cust from Customer as cust” where Customer is referring to an EntityClass in my model.

The difference between using this with ObjectServices vs. EntityCLient is that in ObjectServices, you will have already identified the namespace that the CustomerClass lives in when you create the ObjectContext.

FOr example,

Dim myAWEntities=New AdventureWorksEntities

So when you create the ObjectQuery, it actually barfs, I mean throws an exception, if you tell it the namespace again. So you just want plain old Customers.

If my query read “Select cust from AdventureWorksEntities.Customer as cust”

The exception would be

Failed to resolve AdventureWorksEntities.Customer’ in the current scope or context. Make sure referenced variables are in scope, required schemas are loaded and namespaces referenced correctly, near multipart identifier, line xxx, number xxx.

Now with EntityClient, there is no indication outside of the query string as to the namespace, so you NEED to tell it the namespace.

Unfortunately, it’s not obvious because if you look at examples out on the web you’ll see it both ways and it might take a while (as it did in my case) for the subtle difference to become clear.

More Beta 3 clues for Entity Framework: Compiled queries and TSQL in debugging

I sometimes feel like Gretel picking up tidbits on my way to the Gingerbread house when it comes to getting clues about what’s coming in Beta3 of Entity Framework.

The next two I have found are:

From Alex James blog, Entity Framework is getting compiled queries similar to what’s in LINQ to SQL. You can pre-compile query expressions, save them and even pass them around.

One thing that Alex mentions is that they are not tied to the ObjectContext (which is how you can pass them around) and therefore it must be the magic behind the next tidbit – which is that we’ll be able to get at the TSQL generated from the query expressions more easily.as per Danny Simmons in this forum thread.

It is currently possible to see the TSQL in a convoluded way of digging into the EntityCommand that is explained in the answer to this forum post. WHen I saw that, I tried to write a debugger visualizer but discovered that because the EntityCommand is not serializable (nor the objectQuery, from which you can grab the EntityCOmmand) there was no way to get the commandtree over to a separate process where the debugger is hosted. Someone actually got around it with an enormous number of lines of code (see this forum thread) but I decided that I would just bide my time for a simpler way to appear in the bits.

We’ll see in a few weeks what it looks like. 

Welcome to Alex James, a new PM for Entity Framework

As Entity Framework gets deeper and deeper, the responsibility of building and managing what will become Microsoft’s core for data access must get divvied up.

Alex James has recently moved from New Zealand to  join the team as Program Manager for MetaData in entity framework. That does sound narrow, but it’s great that there’s someone focused on that part of the puzzle, rather than the objects, LINQ to ENtities etc.

He’s already written a bunch of posts about things I have been wanting to dig further into, so this is a win win situation as far as I’m concerened.

As his blog is new, it’s easy enough to catch up by starting wtih the first post and read them all.

http://blogs.msdn.com/alexj/default.aspx

Hey Data Geeks! Geek out on ADO.NET at DevConnections again in Spring 2008

I’m happy to announce that DevConnections will be hosting a Data Access track again in the Spring 2008 conference (Orlando April 23- 28).

The Data Access track in the recent Las Vegas edition of DevConnections was a great success. Thanks to a dedicated track, there was a Data Access talk happening during every timeslot during the conference. We had 4 Microsoft sessiosn on Microsoft day, nine during the two “3rd party speaker” days and a post-con session.

The room for this track (which had app. 300 seats) was packed for many sessions. The 4 introductory level Entity Framework sessions were practically standing room only and Dino Esposito’s presentation “Typed DataSets, LINQ to SQL, LINQ to Entities: Data Design Patterns Do Matter” was flowing out of the doorway!

So we think it was a great idea and are doing it again in the spring.

Here’s what we’ve got lined up (which will hit the website in the next week or so):

Pre-Conference workshop:I will be doing a full day pre-con session called “Entity Framework From 0 to 60” which will start with intro and eventually dig way down under the covers for doing advanced work with EF. Entity Framework is due to be released in the first half of next year so if it’s not already out by the time the conference rolls around, it will be darned close, so it will be high time to get ready for this technology!

Day 1: Microsoft will be doing two intermediate/advanced Entity Framework talks, a talk on ADO.NET Data Services and Synchronization Services.

Day 2 & 3: We have a great line up of speakers again: Bill Vaughn, Kathleen Dollard, John Papa, Dino Esposito, Cathi Gero, Dave Sussman, DOn Kiely and myself. THe topics will range from Synchronization SErvices to Performance,  intro & intermediate sessions on Entitity Framework, deep dives into ENtity Framework and LINQ to SQL and more.

So when the snow starts melting, think spring and think DATA! See you in Orlando!