Home
Help
Register
Log in

Search

 
   Active Threads  

You are here: Home > LLBLGen Pro > Bugs & Issues> MySQL issues in .NET Core/Standard Self-Servicing
 

Pages: 1
Bugs & Issues
MySQL issues in .NET Core/Standard Self-Servicing
Page:1/1 

  Print all messages in this thread  
Poster Message
scotru
User



Location:
College Place, WA
Joined on:
16-Feb-2006 01:03:42
Posted:
103 posts
# Posted on: 14-Feb-2018 20:09:00.  
Greetings,

I'm experiencing a couple of problems trying to migrate to .NET Core/Standard and LLBLGen 5.3 (5.3.3 RTM currently).

1) We're getting:
Code:

System.IO.FileNotFoundException: 'Could not load file or assembly 'System.Data.SqlClient, Version=4.2.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a'. The system cannot find the file specified.'

at SD.LLBLGen.Pro.ORMSupportClasses.PersistenceCore.CleanupDataReader(IDataReader reader, IQuery queryExecuted, Boolean disposeReader)\r\n at SD.LLBLGen.Pro.ORMSupportClasses.EntityMaterializerBase.Materialize(Func`4 valueReadErrorHandler, String& failureErrorText)\r\n at SD.LLBLGen.Pro.ORMSupportClasses.DaoBase.ExecuteMultiRowRetrievalQuery(IRetrievalQuery queryToExecute, ITransaction containingTransaction, IEntityCollection collectionToFill, Boolean allowDuplicates, IEntityFields fieldsUsedForQuery, IFieldPersistenceInfo[] fieldPersistenceInfos)\r\n at SD.LLBLGen.Pro.ORMSupportClasses.DaoBase.PerformGetMultiAction(ITransaction containingTransaction, QueryParameters parameters)\r\n at SD.LLBLGen.Pro.ORMSupportClasses.EntityCollectionBase`1.GetMulti(IPredicate selectFilter)\r\n at DevArtTest.Program.PrintTermLLBL() in ....


I don't see why it's trying to call SqlClient when we are using MySQL. Here's our DQE config:

Code:

         RuntimeConfiguration.AddConnectionString("ConnectionString.MySql (MySqlDirect)", "Server=localhost;Database=XXX;Uid=YYY;Pwd=ZZZ;License Key=[redacted];");
            // Configure the DQE
            RuntimeConfiguration.ConfigureDQE<MySqlDQEConfiguration>(                
                                            c => c.AddDbProviderFactory(typeof(Devart.Data.MySql.MySqlProviderFactory)).
                                                 SetIncludeCatalogNameInObjectNamesFlag(false)
                                                 );


Is there a System.Data.SqlClient dependency even when using MySQL? It does seem to work if we add the reference to that.

2) Our 2nd issue happens both in .NET Full and in .NET Core. Even if we set:
                                                 SetIncludeCatalogNameInObjectNamesFlag(false)
Our generated code appears to rely on a matching catalog name.

Specifically it's included in InitXXXEntityMappings calls to AddElementMapping in the generated PersistenceInfoProvider.cs

How can we go about specifying the catalog name at runtime for MySQL?

Thanks for your help!



  Top
Otis
LLBLGen Pro Team



Location:
The Hague, The Netherlands
Joined on:
17-Aug-2003 18:00:36
Posted:
37319 posts
# Posted on: 15-Feb-2018 09:10:41.  
We'll look into it.

Frans Bouma
LLBLGen Pro / ORM Profiler Lead Developer | Blog | Twitter
 
Top
Otis
LLBLGen Pro Team



Location:
The Hague, The Netherlands
Joined on:
17-Aug-2003 18:00:36
Posted:
37319 posts
# Posted on: 15-Feb-2018 10:59:17.  
scotru wrote:
Greetings,

I'm experiencing a couple of problems trying to migrate to .NET Core/Standard and LLBLGen 5.3 (5.3.3 RTM currently).

1) We're getting:
Code:

System.IO.FileNotFoundException: 'Could not load file or assembly 'System.Data.SqlClient, Version=4.2.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a'. The system cannot find the file specified.'

at SD.LLBLGen.Pro.ORMSupportClasses.PersistenceCore.CleanupDataReader(IDataReader reader, IQuery queryExecuted, Boolean disposeReader)\r\n at SD.LLBLGen.Pro.ORMSupportClasses.EntityMaterializerBase.Materialize(Func`4 valueReadErrorHandler, String& failureErrorText)\r\n at SD.LLBLGen.Pro.ORMSupportClasses.DaoBase.ExecuteMultiRowRetrievalQuery(IRetrievalQuery queryToExecute, ITransaction containingTransaction, IEntityCollection collectionToFill, Boolean allowDuplicates, IEntityFields fieldsUsedForQuery, IFieldPersistenceInfo[] fieldPersistenceInfos)\r\n at SD.LLBLGen.Pro.ORMSupportClasses.DaoBase.PerformGetMultiAction(ITransaction containingTransaction, QueryParameters parameters)\r\n at SD.LLBLGen.Pro.ORMSupportClasses.EntityCollectionBase`1.GetMulti(IPredicate selectFilter)\r\n at DevArtTest.Program.PrintTermLLBL() in ....


I don't see why it's trying to call SqlClient when we are using MySQL. Here's our DQE config:

Code:

         RuntimeConfiguration.AddConnectionString("ConnectionString.MySql (MySqlDirect)", "Server=localhost;Database=XXX;Uid=YYY;Pwd=ZZZ;License Key=[redacted];");
            // Configure the DQE
            RuntimeConfiguration.ConfigureDQE<MySqlDQEConfiguration>(                
                                            c => c.AddDbProviderFactory(typeof(Devart.Data.MySql.MySqlProviderFactory)).
                                                 SetIncludeCatalogNameInObjectNamesFlag(false)
                                                 );


Is there a System.Data.SqlClient dependency even when using MySQL? It does seem to work if we add the reference to that.

This is caused by the fact the SqlAzure recovery strategy is part of the ORMSupportClasses, and that relies on SqlClient as it refers to SqlException. Before this wasn't noticed as SqlClient is part of the .NET framework and always present. However with .net core you have to install it separately. We can't do this in another way as it would require moving the SqlAzure recovery strategy to another assembly, namely the SQLServer DQE which isn't referenced by most people in the code they'll use the strategy and a breaking change for almost all code using this strategy.

We did notice that we didn't include this dependency in our nuget spec file for ORMSupportClasses for netstandard2.0. We'll correct this. For now install the sqlclient package separately using nuget or paket.

Quote:

2) Our 2nd issue happens both in .NET Full and in .NET Core. Even if we set:
                                                 SetIncludeCatalogNameInObjectNamesFlag(false)
Our generated code appears to rely on a matching catalog name.

Specifically it's included in InitXXXEntityMappings calls to AddElementMapping in the generated PersistenceInfoProvider.cs

How can we go about specifying the catalog name at runtime for MySQL?

We'll look into this issue, it might be the setting isn't applied properly.
Frans Bouma
LLBLGen Pro / ORM Profiler Lead Developer | Blog | Twitter
 
Top
Otis
LLBLGen Pro Team



Location:
The Hague, The Netherlands
Joined on:
17-Aug-2003 18:00:36
Posted:
37319 posts
# Posted on: 15-Feb-2018 14:02:31.  
The bug is so stupid Embarrassed

Code:

public override string CreateObjectName(string catalogName, string schemaName, string elementName)
{
    var fragments = new QueryFragments(".", 16);
    string catalogNameToUse = catalogName;
    DynamicQueryEngineBase dqe = new DynamicQueryEngine();
    if(DynamicQueryEngine.IncludeCatalogNameInObjectNames && !string.IsNullOrEmpty(catalogNameToUse))
    {
        catalogNameToUse = dqe.GetNewCatalogName(this.GetNewPerCallCatalogName(catalogNameToUse));
    }
    AppendValidIdentifier(fragments, catalogNameToUse);
    AppendValidIdentifier(fragments, elementName);
    return fragments.ToString();
}

Bonus points if you can spot it Wink

Fixing now.


Frans Bouma
LLBLGen Pro / ORM Profiler Lead Developer | Blog | Twitter
 
Top
Otis
LLBLGen Pro Team



Location:
The Hague, The Netherlands
Joined on:
17-Aug-2003 18:00:36
Posted:
37319 posts
# Posted on: 19-Feb-2018 16:26:49.  
Fix is now available in v5.2.7/5.3.4 hotfix builds
Frans Bouma
LLBLGen Pro / ORM Profiler Lead Developer | Blog | Twitter
 
Top
rlucassen
User



Location:

Joined on:
25-Oct-2013 13:15:53
Posted:
18 posts
# Posted on: 15-Apr-2019 12:04:51.  
Hi Otis,

i know this is a old thread but i just started using llblgen 5.5 in a .net core 2 console app.

I Use MySql but llblgen wants a SqlClient

It seems like the issue is still occuring.
Code:

RuntimeConfiguration.ConfigureDQE<MySqlDQEConfiguration>(
c => c.AddDbProviderFactory(typeof(Devart.Data.MySql.MySqlProviderFactory)));

Code:

Could not load file or assembly 'System.Data.SqlClient, Version=4.2.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a'. The system cannot find the file specified.

at SD.LLBLGen.Pro.ORMSupportClasses.PersistenceCore.CleanupDataReader(IDataReader reader, IQuery queryExecuted, Boolean disposeReader)
at SD.LLBLGen.Pro.ORMSupportClasses.DaoBase.ExecuteSingleRowRetrievalQuery(IRetrievalQuery queryToExecute, ITransaction containingTransaction, IEntityFields fieldsToFill, IFieldPersistenceInfo[] fieldPersistenceInfos)
at SD.LLBLGen.Pro.ORMSupportClasses.DaoBase.PerformFetchEntityAction(IEntity entityToFetch, ITransaction containingTransaction, IPredicateExpression selectFilter, IPrefetchPath prefetchPathToUse, Context contextToUse, ExcludeIncludeFieldsList excludedIncludedFields)
at SD.LLBLGen.Pro.ORMSupportClasses.DaoBase.FetchExisting(IEntity entityToFetch, ITransaction containingTransaction, IPrefetchPath prefetchPathToUse, Context contextToUse, ExcludeIncludeFieldsList excludedIncludedFields)


SupportClasses Version 5.5.1


  Top
Walaa
Support Team



Location:

Joined on:
21-Aug-2005 16:03:48
Posted:
14449 posts
# Posted on: 15-Apr-2019 20:15:15.  
I just installed the SD.LLBLGen.Pro.ORMSupportClasses from Nuget (v.5.5.2), and it has the dependency to the SQLClient library. I also see this dependency on all previous versions.

Please use Nuget to deploy the ORMSupportClasses.
  Top
Otis
LLBLGen Pro Team



Location:
The Hague, The Netherlands
Joined on:
17-Aug-2003 18:00:36
Posted:
37319 posts
# Posted on: 16-Apr-2019 09:37:22.  
yes the dependency on the sqlclient is in the ormsupportclasses, which is needed for the SqlAzure strategy for transient error recovery. We can't move that class as that would break all code using it, so we kept it there, with the consequence that it requires that dependency.



Frans Bouma
LLBLGen Pro / ORM Profiler Lead Developer | Blog | Twitter
 
Top
rlucassen
User



Location:

Joined on:
25-Oct-2013 13:15:53
Posted:
18 posts
# Posted on: 16-Apr-2019 11:14:24.  
Otis wrote:
Fix is now available in v5.2.7/5.3.4 hotfix builds


I assumed it was fixed but im guessing the was something else
  Top
Walaa
Support Team



Location:

Joined on:
21-Aug-2005 16:03:48
Posted:
14449 posts
# Posted on: 16-Apr-2019 16:26:34.  
That was for the CatalogName overwrite, the second issue in the original message.

  Top
Pages: 1  


Powered by HnD ©2002-2007 Solutions Design
HnD uses LLBLGen Pro

Version: 2.1.12172008 Final.