LinqConnect Professional Version 4.8.1350 (30-Oct-2017) - error when create context for MS SQL

Discussion of open issues, suggestions and bugs regarding LinqConnect – Devart's LINQ to SQL compatible ORM
Post Reply
AKRRKA
Posts: 198
Joined: Thu 26 Jan 2012 15:07
Location: Russia
Contact:

LinqConnect Professional Version 4.8.1350 (30-Oct-2017) - error when create context for MS SQL

Post by AKRRKA » Fri 24 Nov 2017 15:38

After updating the components from LinqConnect Professional Version 4.5.1024 (07-Jul-2016) to LinqConnect Professional Version 4.8.1350 (30-Oct-2017) get connection open error when create context.

ATTENTION! I did not need to connect to the database, I just had to create a context. To use it to check the existence of a database by a command (context.DatabaseExists()), and to create it as a command (context.CreateDatabase()) if necessary.

Now began to appear errors with such stacktrace:

Code: Select all

System.Data.SqlClient.SqlException was caught
  HResult=-2146232060
  Message=Не удается открыть базу данных "cetest", запрашиваемую именем входа. Не удалось выполнить вход.
Ошибка входа пользователя "sa".
  Source=.Net SqlClient Data Provider
  ErrorCode=-2146232060
  Class=11
  LineNumber=65536
  Number=4060
  Procedure=""
  Server=10.5.5.199
  State=1
  StackTrace:
       в System.Data.SqlClient.SqlInternalConnectionTds..ctor(DbConnectionPoolIdentity identity, SqlConnectionString connectionOptions, SqlCredential credential, Object providerInfo, String newPassword, SecureString newSecurePassword, Boolean redirectedUserInstance, SqlConnectionString userConnectionOptions, SessionData reconnectSessionData, DbConnectionPool pool, String accessToken, Boolean applyTransientFaultHandling)
       в System.Data.SqlClient.SqlConnectionFactory.CreateConnection(DbConnectionOptions options, DbConnectionPoolKey poolKey, Object poolGroupProviderInfo, DbConnectionPool pool, DbConnection owningConnection, DbConnectionOptions userOptions)
       в System.Data.ProviderBase.DbConnectionFactory.CreateNonPooledConnection(DbConnection owningConnection, DbConnectionPoolGroup poolGroup, DbConnectionOptions userOptions)
       в System.Data.ProviderBase.DbConnectionFactory.TryGetConnection(DbConnection owningConnection, TaskCompletionSource`1 retry, DbConnectionOptions userOptions, DbConnectionInternal oldConnection, DbConnectionInternal& connection)
       в System.Data.ProviderBase.DbConnectionInternal.TryOpenConnectionInternal(DbConnection outerConnection, DbConnectionFactory connectionFactory, TaskCompletionSource`1 retry, DbConnectionOptions userOptions)
       в System.Data.SqlClient.SqlConnection.TryOpenInner(TaskCompletionSource`1 retry)
       в System.Data.SqlClient.SqlConnection.TryOpen(TaskCompletionSource`1 retry)
       в System.Data.SqlClient.SqlConnection.Open()
       в Devart.Data.SqlServer.Linq.Provider.SqlDataProvider.Initialize(Object connection)
       в Devart.Data.Linq.DataProvider.a(IDataServices A_0, Object A_1)
       в Devart.Data.Linq.DataContext.a(Object A_0, MappingSource A_1, Type A_2, String A_3, Boolean A_4)
       в Devart.Data.Linq.DataContext..ctor(String connectionString, MappingSource mapping)
       в ceData.Context.ceDataContext..ctor(String connection, MappingSource mappingSource) в d:\Repository\mvp\trunk\source\ceModules\ceData.Context\ceDataContext.Designer.cs:строка 387
       в ceData.Context.SqlClientCeDataContext..ctor(String connection, MappingSource mappingSource) в d:\Repository\mvp\trunk\source\ceModules\ceData.Context\ceCommon.cs:строка 226
       в ceData.Context.Service.CreateDataContext(String sProviderPrefix, String sConnectionString, Boolean bOpenAfterCreate) в d:\Repository\mvp\trunk\source\ceModules\ceData.Context\ceCommon.cs:строка 118
       в ceDataSource.Model.DataSource.CreateDataContext(String sProviderPrefix, String sConnectionString, Boolean bOpenAfterCreate, Boolean bKeepUpConnectionActive) в d:\Repository\mvp\trunk\source\ceModules\ceDataSource.Model\DataSource.cs:строка 2019
  InnerException: 
As you can see after creating the context:

Code: Select all

       в Devart.Data.SqlServer.Linq.Provider.SqlDataProvider.Initialize(Object connection)
       в Devart.Data.Linq.DataProvider.a(IDataServices A_0, Object A_1)
       в Devart.Data.Linq.DataContext.a(Object A_0, MappingSource A_1, Type A_2, String A_3, Boolean A_4)
       в Devart.Data.Linq.DataContext..ctor(String connectionString, MappingSource mapping)
for some reason, there is an attempt to connect to the database.

Code: Select all

       в System.Data.SqlClient.SqlConnection.Open()
Because of this, an exception is thrown and the context is not created.

Connection string:

Code: Select all

data source=10.5.5.199;initial catalog=cedatabase;integrated security=False;persist security info=False;Pooling=False;connect timeout=15;user id=sa;password=***********
This problem appeared only with MS SQL Server, with other types of database is not observed.

PS: This problem is very serious, I have broken the functionality to create a database. Very much I ask to help or assist as soon as possible.
Last edited by AKRRKA on Fri 24 Nov 2017 16:25, edited 2 times in total.

Shalex
Site Admin
Posts: 9543
Joined: Thu 14 Aug 2008 12:44

Re: LinqConnect Professional Version 4.8.1350 (30-Oct-2017) - error when create context for MS SQL

Post by Shalex » Mon 27 Nov 2017 16:08

We have reproduced the bug and will notify you when it is fixed.

AKRRKA
Posts: 198
Joined: Thu 26 Jan 2012 15:07
Location: Russia
Contact:

Re: LinqConnect Professional Version 4.8.1350 (30-Oct-2017) - error when create context for MS SQL

Post by AKRRKA » Tue 28 Nov 2017 06:54

OK. A big request, if possible, is to mail me an build with fixing this problem before the release (if the release is not planned soon). This problem for me is very critical and delayed release of our product.
Or if it's not possible to quickly fix it, please tell me which version can be rolled back so that there is not this problem.

Shalex
Site Admin
Posts: 9543
Joined: Thu 14 Aug 2008 12:44

Re: LinqConnect Professional Version 4.8.1350 (30-Oct-2017) - error when create context for MS SQL

Post by Shalex » Wed 29 Nov 2017 14:04

The bug with initializing DataContext with non-existing database name in its connection string is fixed. We have sent an internal build with the fix to you by email.

AKRRKA
Posts: 198
Joined: Thu 26 Jan 2012 15:07
Location: Russia
Contact:

Re: LinqConnect Professional Version 4.8.1350 (30-Oct-2017) - error when create context for MS SQL

Post by AKRRKA » Thu 30 Nov 2017 16:19

Thank you.
The error has been fixed.

Shalex
Site Admin
Posts: 9543
Joined: Thu 14 Aug 2008 12:44

Re: LinqConnect Professional Version 4.8.1350 (30-Oct-2017) - error when create context for MS SQL

Post by Shalex » Thu 11 Jan 2018 18:19

The bug with initializing DataContext with non-existing database name in its connection string is fixed (SQL Server): viewtopic.php?f=31&t=36450.

Post Reply