Git Product home page Git Product logo

clutch's People

Contributors

gregors avatar kukkimonsuta avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

clutch's Issues

Get rid of SqlClient dependency

In order to make your library more universal I suggest to get rid of the System.Data.SqlClient dependency. This can be done pretty simple by replacing SqlParameter class by more generic DbParameter in DbDbTracingExtensions.cs

I did it locally and now it works fine with any db.

EF5(4.4) ,Net4 code first approach with sybase throws "Unable to determine the provider name for connection of type 'iAnywhere.Data.SQLAnywhere.SAConnection'."

EF5(4.4) ,Net4 code first approach with sybase throws "Unable to determine the provider name for connection of type 'iAnywhere.Data.SQLAnywhere.SAConnection'."

I can log fine with SQL server connection. Also works with sybase model first Objectcontect class

But when I try the code first approach using the DbContext Class I get the error
"Unable to determine the provider name for connection of type 'iAnywhere.Data.SQLAnywhere.SAConnection'.""

I've tried all sort for days and days. Any clues would be helpful

Strong name sign assemblies

One cannot include the Clutch assemblies if the project is strong named. VS2010 throws the following error:

error CS1577: Assembly generation failed -- Referenced assembly 'Clutch.Diagnostics.EntityFramework' does not have a strong name

Enhancement request to strong name sign the Clutch assemblies.

Exception after upgrading to EF 6

    System.InvalidCastException: Unable to cast object of type 'Clutch.Diagnostics.EntityFramework.DbTracingConnection' to type 'System.Data.SqlClient.SqlConnection'.
       at System.Data.SqlClient.SqlCommand.set_DbConnection(DbConnection value)
       at System.Data.Common.DbCommand.set_Connection(DbConnection value)
       at System.Data.Entity.Internal.InterceptableDbCommand.set_DbConnection(DbConnection value)
       at System.Data.Common.DbCommand.set_Connection(DbConnection value)
       at System.Data.Entity.Core.Common.Utils.CommandHelper.SetStoreProviderCommandState(EntityCommand entityCommand, EntityTransaction entityTransaction, DbCommand storeProviderCommand)
       at System.Data.Entity.Core.EntityClient.Internal.EntityCommandDefinition.PrepareEntityCommandBeforeExecution(EntityCommand entityCommand)
       at System.Data.Entity.Core.EntityClient.Internal.EntityCommandDefinition.ExecuteStoreCommands(EntityCommand entityCommand, CommandBehavior behavior)
       at System.Data.Entity.Core.Objects.Internal.ObjectQueryExecutionPlan.Execute[TResultType](ObjectContext context, ObjectParameterCollection parameterValues)
       at System.Data.Entity.Core.Objects.ObjectQuery`1.<>c__DisplayClassb.<GetResults>b__a()
       at System.Data.Entity.Core.Objects.ObjectContext.ExecuteInTransaction[T](Func`1 func, IDbExecutionStrategy executionStrategy, Boolean startLocalTransaction, Boolean releaseConnectionOnSuccess)
       at System.Data.Entity.Core.Objects.ObjectQuery`1.<>c__DisplayClassb.<GetResults>b__9()
       at System.Data.Entity.SqlServer.DefaultSqlExecutionStrategy.Execute[TResult](Func`1 operation)
       at System.Data.Entity.Core.Objects.ObjectQuery`1.GetResults(Nullable`1 forMergeOption)
       at System.Data.Entity.Core.Objects.ObjectQuery`1.<System.Collections.Generic.IEnumerable<T>.GetEnumerator>b__0()
       at System.Lazy`1.CreateValue()
       at System.Lazy`1.LazyInitValue()
       at System.Lazy`1.get_Value()
       at System.Data.Entity.Internal.LazyEnumerator`1.MoveNext()
       at System.Linq.Enumerable.Single[TSource](IEnumerable`1 source)
       at System.Data.Entity.Core.Objects.ELinq.ObjectQueryProvider.<GetElementFunction>b__3[TResult](IEnumerable`1 sequence)
       at System.Data.Entity.Core.Objects.ELinq.ObjectQueryProvider.ExecuteSingle[TResult](IEnumerable`1 query, Expression queryRoot)
       at System.Data.Entity.Core.Objects.ELinq.ObjectQueryProvider.System.Linq.IQueryProvider.Execute[TResult](Expression expression)
       at System.Data.Entity.Internal.Linq.DbQueryProvider.Execute[TResult](Expression expression)
       at System.Linq.Queryable.Any[TSource](IQueryable`1 source, Expression`1 predicate)
       at MyApp.App.CheckDatabaseConnection() in d:\Code\MyApp\src\MyApp\App.xaml.cs:line 218

Disposing System.Data.EntityClient.EntityDataReader leads to an exception

Issue

Disposing an instance of EntityDataReader class leads to rising InvalidOperationException: Reader timing has already finished .

Cause

The exception is thrown by the DbTracingContext.OnReaderFinished() method called second time from the DbTracingDataReader.Close().

In turn, DbTracingDataReader.Close() method is called twice due to the implementation of the Dispose() method in the EntityDataReader class (see the sources):

162        public override void Close()
163        {
164            if (this._command != null)
165            {
166               this._storeDataReader.Close();
167                
168               // other code
176            }
177        }
178 
183        protected override void Dispose(bool disposing)
184        {
185            base.Dispose(disposing);
186            if (disposing)
187            {
188                this._storeDataReader.Dispose();
189            }
190        }

this._storeDataReader field store an instance of the DbTracingDataReader and it is disposing twice in the lines 166 and 188. And the base Dispose() method in the line 185 internally calls virtual Close() method.

Solution

DbTracingDataReader class ьгые support multiple calls to the Close() method.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.