MySql DevArt and CoreLab users please read (.NET 2.0+ specific)

Posts   
 
    
Otis avatar
Otis
LLBLGen Pro Team
Posts: 39767
Joined: 17-Aug-2003
# Posted on: 26-Jun-2009 12:43:08   

Starting today, 26-jun-2009, v2.6 will have support for both CoreLab's providers and DevArt providers. This has effect on the MySql driver, the MySql specific templates and the MySql DQE. We've done this by using the ADO.NET DbProviderFactory system to create a generic driver for MySql which can use both CoreLab's 3.55/4.x provider and DevArt's provider.

What are the consequences? As the Driver, templates and DQE now use the DbProviderFactory, CoreLab's licensing system changes: you have to install the provider on the target system, as described in CoreLab/DevArt's manual under the section 'Licensing'. This is CoreLab/DevArt's responsibility so for licensing problems, please report them to DevArt's support.

The providers register themselves in the machine.config file so you should simply be able to re-generate the code, use the new DQE and everything should work properly.

If you run into problems still, please post them in the Bugs and Issues forum: http://www.llblgen.com/tinyforum/Threads.aspx?ForumID=10 . If they're related to "License not valid/found" issues of the CoreLab provider, please consult DevArt support for that, we won't answer licensing related questions regarding their provider.

We hope there are no glitches with the new DevArt provider. If you run into one, please report them a.s.a.p. so we can fix it.

We didn't want to make this move in between versions but we have no choice: CoreLab changed its name to DevArt so everyone who purchases a new provider from them can't use LLBLGen Pro anymore, so we had to come up with a fix. Using the DbProviderFactory system is the easiest way to do this as for customers it's transparent and for us it makes it possible to re-use code.

manual registration of provider factory If you want to manually register the provider factory, add this to your application's config file:


<system.data>
  <DbProviderFactories>
    <add name="CoreLab.MySql.MySqlDirectFactory" invariant="CoreLab.MySql" description=".Net Framework Data Provider for MySql CRLAB" type="CoreLab.MySql.MySqlDirectFactory, CoreLab.MySql, Version=3.55.24.0, Culture=neutral, PublicKeyToken=09af7300eec23701" />
  </DbProviderFactories>
</system.data>

where the Version is the version of the corelab provider you're using, e.g. 3.55.24.0 or 4.0.9.0 etc.

Frans Bouma | Lead developer LLBLGen Pro
rdhatch
User
Posts: 198
Joined: 03-Nov-2007
# Posted on: 10-Feb-2010 06:32:19   

UPDATE: CoreLab / DevArt will work without installing on the server. See replies below.

Warning to all CoreLab/DevArt MySQL users.

After much distress & technical support, I've now realized that to deploy - you must install the CoreLab/DevArt MySQL driver on the app/web server.

See DbProviderFactory & Licensing: http://www.devart.com/dotconnect/mysql/docs/Licensing.html#dbprov

CoreLab's licensing for DbProviderFactory introduces a big pain we hadn't experienced with the previous DQE. I've tried all possible work-arounds (including copying policy.4.85.CoreLab.MySql.dll from GAC_MSIL to bin) - to no avail.

One of my shared hosting servers just denied the install. Ugg!!

Hope this helps some of you - before you pull all your hair out. I'm going bald! wink

Ryan

PS. Perhaps the MySQL GPL driver would now be better for easy deployment purposes. After all, our apps no longer reference it. And yes - I can confirm this works!

Otis avatar
Otis
LLBLGen Pro Team
Posts: 39767
Joined: 17-Aug-2003
# Posted on: 10-Feb-2010 10:33:37   

Is the installer really necessary? I think it just copies files to the GAC and adds a factory definition line in the machine.config file. please check the local machine.config file on your system and copy that line into the config file of your own application. That should make sure the factory is defined, even though it's not installed in the machine.config. Similar to what we do in the llblgenpro.exe.config in v3 for firebird and postgresql:

<system.data>
    <DbProviderFactories>
        <!-- Firebird -->
        <add name="Firebird Client Data Provider"
         invariant="FirebirdSql.Data.FirebirdClient"
         description=".Net Framework Data Provider for Firebird"
         type="FirebirdSql.Data.FirebirdClient.FirebirdClientFactory, FirebirdSql.Data.FirebirdClient, Version=2.1.0.0, Culture=neutral, PublicKeyToken=3750abcc3150b00c"  />
        <!-- PostgreSql -->
        <add name="PostgreSql Client Data Provider"
         invariant="Npgsql"
         description=".Net Framework Data Provider for PostgreSql"
         type="Npgsql.NpgsqlFactory, Npgsql, Version=2.0.4.0, Culture=neutral, PublicKeyToken=5d8b90d52f46fda7" />
    </DbProviderFactories>
</system.data>

please let me know if this works out or not.

Frans Bouma | Lead developer LLBLGen Pro
rdhatch
User
Posts: 198
Joined: 03-Nov-2007
# Posted on: 10-Feb-2010 14:36:25   

Hi Frans -

Hopefully someone can prove me wrong. It works locally, but not when I deploy. I copied my machine.config line right into my web.config:


<system.data>
    <DbProviderFactories>
     <remove invariant="CoreLab.MySql"/>

     <add name="MyDirect .NET" invariant="CoreLab.MySql" description="CoreLab MyDirect .NET" type="CoreLab.MySql.MySqlDirectFactory, CoreLab.MySql, Version=4.85.36.0, Culture=neutral, PublicKeyToken=09af7300eec23701" />
    </DbProviderFactories>
</system.data> 

I tried all of this yesterday - for several hours. DQE could not load the driver.

I then attempted to load the driver manually using DbProviderFactories.GetFactory("CoreLab.MySql"). I could not get past the error: DLL or one of its dependencies could not be loaded, assembly manifest definition does not match.

I had CoreLab.Data & CoreLab.MySQL in my bin folder. I even copied the policy.4.85.CoreLab.MySql.dll & its config from GAC_MSIL into my bin folder, which included CoreLab's assembly version bindings. I also tried my own assembly version bindings seen below. No go. That was my several-hours-long-experience yesterday.

policy config bindings:


         <dependentAssembly>
            <assemblyIdentity name="CoreLab.MySql" publicKeyToken="09af7300eec23701" culture="neutral"/>
            <bindingRedirect oldVersion="4.0.0.0-4.85.36.0" newVersion="4.85.36.0"/>
         </dependentAssembly>

My custom binding attempts:


    <dependentAssembly>
        <assemblyIdentity name="CoreLab.MySql" publicKeyToken="09af7300eec23701" culture="neutral"/>
        <bindingRedirect oldVersion="0.0.0.0-65535.65535.65535.65535" newVersion="4.85.36.0"/>
    </dependentAssembly>
    <dependentAssembly>
        <assemblyIdentity name="CoreLab.Data" publicKeyToken="09af7300eec23701" culture="neutral"/>
        <bindingRedirect oldVersion="0.0.0.0-65535.65535.65535.65535" newVersion="4.70.24.0"/>
    </dependentAssembly>

Perhaps someone can prove me wrong - Maybe I missed something. I'd be happy to be wrong in this case.

Can anyone confirm CoreLab driver working with DbProviderFactories - without install on server?

Ryan

Otis avatar
Otis
LLBLGen Pro Team
Posts: 39767
Joined: 17-Aug-2003
# Posted on: 10-Feb-2010 14:48:21   

The binding redirects are not necessary, you have to define the factory, that's all (as the DQE doesn't reference any corelab driver anymore). For the factory, you've to specify the real version, so rightclick on the Corelab.MySql dll and check the version. (assembly version), then specify that version in the factory definition.

Corelab/devart confirmed to you that you had to install the provider on the server? What's their solution if that doesn't work/can't be done?

Frans Bouma | Lead developer LLBLGen Pro
rdhatch
User
Posts: 198
Joined: 03-Nov-2007
# Posted on: 10-Feb-2010 15:00:45   

I put in the correct version number.

You're right - the binding redirects aren't necessary - But the error I got said either a dependency could not be loaded or assembly manifest mismatch. Just to be sure it found the right drivers, I tried the redirects as a last ditch effort.

In every forum I read, I could not find one instance where people didn't install it. Maybe someone knows a trick.

I've contacted DevArt support & will let you know what they say.

Ryan

rdhatch
User
Posts: 198
Joined: 03-Nov-2007
# Posted on: 10-Feb-2010 16:33:39   

Well, I am Happy to say... After a fresh try this morning in coordination with DevArt - I was wrong! I was chasing a red herring.

I got it working with a new clean app, just using bin folder. No installation necessary. What a relief.

I wish CoreLab/DevArt's documentation stated this is possible, because it clearly states the opposite. It was a red herring for me - I spent hours jumping through hoops with my hosting provider to get it installed. Apparently, that wasn't the problem. I'm not sure what I got wrong before in my production app? Perhaps the server had cached my old CoreLab DLL, hence the manifest errors? Nevertheless - it is now working!

I am happy to attach a simple demo app that people can follow as an example.

Sometimes, I'm happy to stand corrected. wink Hope this helps!

Ryan

PS. Frans - I don't see the attachment icon.