Archive for May, 2007
MiX sessions online
Didn’t make MiX ’07? Neither did I. That’s ok, though, cause the sessions are all online here. Alot of great content here. I’m listening to a session talking about PHP on Windows. Gotta get back….
Checking out KDE4
So I decided to download the KDE4 live preview ISO and see what those guys have been up to. First pass was through Virtual PC 2007. It initially seemed to boot ok but I eventually landed on a blank screen which didn’t budge for nearly 45 minutes. Either it was dead or taking an ridiculously long time. Scratch.
Next I tried VMWare 6 RC1 and found success. The image booted up nicely (although a bit slowly) and I was left with a very blank KDE4 desktop. Very blank. No demos. Nothing to show me what is new. Just a pretty blue screen. Opening up the link for my home folder, I got a very bad looking type of explorer window that had tabs for history, services, network, etc. At this point I was unimpressed and bored.
Is it just me or is the Linux desktop crowd still trying to reproduce what the Mac and Windows folks had about 5 years ago?
The issue with FillSchema
Connector/Net’s MySqlDataAdapter class has a method named FillSchema. This method is intended to populate the metadata for a given query without actually returning any of the data from the query. The only syntax that MySQL has to help with this is SQL_SELECT_LIMIT which limits the number of rows that are returned for a given select. Indeed this is what we are using to prevent the transfer of data across the wire when we only want the metadata.
However, there is a problem. SQL_SELECT_LIMIT does not work in stored procedures and also does not affect inserts, updates, or deletes. So, the upshot of this is that calling FillSchema on a stored procedure will, in fact, execute the stored procedure and return all of the data to the client. This is a waste of bandwidth but it’s worse than that. It will also execute all other DML statements in the procedure.
This is different than what happens with SQL Server and different than what people might expect. With SQL Server, a ‘SET FMTONLY ON’ set statement is sent to the server prior to the command. This prevents all DML from being executed and will return only metadata for any selects. MySQL has no such mechanism.
The thing to remember is that FillSchema will execute the procedure exactly the same as if Fill had been called with only one difference. INOUT and OUT parameters will not have their values set properly on return.
Using the new Connector/Net Web providers
Yesterday I blogged about the release of our latest Connector/Net product. Version 5.1, this release includes the addition of a new namespace MySql.Web. This namespace includes implementations of a Membership and Role provider. These providers work together with the membership and role systems in ASP.Net 2.0 to provide a simple mechanism for web developers to add authentication and role support to their web properties.
As we were unable to include proper documentation for these new providers before release, I thought it proper to write down a few thoughts on how these work and how to use them.
1. Provide a connection string
The Connector/Net installer will register the providers in the proper sections of the machine.config file. When registered, they reference a connection string that is non-existent. To use the providers, you must provide a connection string that points to the database you wish to use and must be named ‘LocalMySqlServer’. You would provide this connection string in your web.config file. Here is an example:
<connectionStrings>
<add name=”LocalMySqlServer” connectionString=”data source=localhost;uid=root;pooling=false” providerName=”MySql.Data.MySqlClient” />
</connectionStrings>
You can also use the Web Configuration Pages in Visual Studio to select the MySQL Membership and Role providers as defaults for your application. Once this is done, controls such as the Login control will work with MySQL.
2. Understand how the schema is handled
We wanted the providers to work with shared hosting environments where only a single database may be available. To do this, the providers can create or update the necessary schema at runtime. This is handled at initialization time. The provider checks the version of the schema in the selected database. If non-existent, then the appropriate schema is created. If older than current, it will be updated to match what this provider is wanting.
There is a possibility of name collision since your tables and the tables for the providers exist in the same database. This is unlikely, though, since the names given to the provider tables are somewhat unique to their purpose.
We’re working on better documentation for these providers and plan to make that available with the 5.1.1 release. Also, we plan to create some articles for our dev zone that will demonstrate how to use these providers.
Where have I been?
I guess I’ve not been paying attention but I just learned that JetBlue is based entirely on Microsoft and .NET technologies. You can read some about it here. Jackie seemed to like it. A friend of mine flew JetBlue to the MySQL users conference and had nothing but good things to say about them. I find it interesting that we hear that companies need to move to Linux to save money and yet here we have one of the low-cost leaders offering world class service on *gasp* Microsoft software. Maybe, just maybe, the bulk of costs incurred by a company are not related to licensing. Nahhh……
Connector/Net 5.1.0 Alpha has been released.
Today we’ve announced the availability of Connector/Net 5.1.0 Alpha. This is a very exciting release for us as it’s the first time we’ve made available our ASP.Net 2.0 web providers and our compact framework support. This release also folds in our Tools for Visual Studio into a single installer.
To that end, we are dropping Tools for Visual Studio as as separate download. Going forward, you can select Visual Studio integration as an option directly from the Connector/Net installer. All the same functionality is there, but packaging the products in this way will simplify bug fixes to the products and give our users a better out of box experience.
We encourage anyone using our products to try out this latest release and let us know what you think. You can read our official release announcement here.
Entity Framework cut. Positive sign?
Microsoft recently announced that they are removing the Entity Framework and tools from Visual Studio “Orcas” and will, instead, ship them as an update in the first half of 2008. It’s pretty easy to see this as YAMM (Yet Another Microsoft Miss) but I instead look at this as a very positive sign of things changing.
Microsoft is accelerating many of the development timelines and embracing the “release early, release often” methodology. It seems that almost every Microsoft product these days comes out as a CTP about a million times even before it his beta stage. This just means greater awareness and better adoption. MS is even releasing alot more code as open source as they recently announced a Dynamic Language Runtime (DLR) that supports languages such as Python and Ruby. They are releasing it under a BSD style license.
It’s clear that Orcas was going to be ready long before the Entity Framework and, rather than hold it up for another 6-9 months, they decided to ship Orcas and bolt on the EF later. This is a good move and indicates that MS is wanting to speed up release cycles all across their divisions. Let’s hope this trend continues.