title: Is there a limit of connections for DbContextFactory
body: <p>I have a quartz job that makes multiple queries to the db.</p>
  <p>I'm using DbContextFactory that provides a DbContext for each query.</p>
  <p>I noticed that for big tasks where they will be thousands of queries application starts to throw the following exception:</p>
  <blockquote>
  <p>System.ObjectDisposedException: Cannot access a disposed object.
  Object name: 'IServiceProvider'.    at
  Microsoft.Extensions.DependencyInjection.ServiceLookup.ThrowHelper.ThrowObjectDisposedException()
  at
  Microsoft.Extensions.DependencyInjection.ServiceLookup.ServiceProviderEngineScope.GetService(Type
  serviceType)    at
  Microsoft.Extensions.DependencyInjection.ServiceProviderServiceExtensions.GetService[T](IServiceProvider
  provider)    at
  Microsoft.EntityFrameworkCore.Diagnostics.Internal.ScopedLoggerFactory.Create(IServiceProvider
  internalServiceProvider, IDbContextOptions contextOptions)    at
  ResolveService(ILEmitResolverBuilderRuntimeContext ,
  ServiceProviderEngineScope )    at
  ResolveService(ILEmitResolverBuilderRuntimeContext ,
  ServiceProviderEngineScope )    at
  ResolveService(ILEmitResolverBuilderRuntimeContext ,
  ServiceProviderEngineScope )    at
  ResolveService(ILEmitResolverBuilderRuntimeContext ,
  ServiceProviderEngineScope )    at
  Microsoft.Extensions.DependencyInjection.ServiceProvider.GetService(Type
  serviceType, ServiceProviderEngineScope serviceProviderEngineScope)<br />
  at
  Microsoft.Extensions.DependencyInjection.ServiceProviderServiceExtensions.GetRequiredService(IServiceProvider
  provider, Type serviceType)    at
  Microsoft.Extensions.DependencyInjection.ServiceProviderServiceExtensions.GetRequiredService[T](IServiceProvider
  provider)    at
  Microsoft.EntityFrameworkCore.DbContext.get_DbContextDependencies()<br />
  at Microsoft.EntityFrameworkCore.DbContext.get_ContextServices()    at
  Microsoft.EntityFrameworkCore.DbContext.get_Model()    at
  Microsoft.EntityFrameworkCore.Internal.InternalDbSet1.get_EntityType()
  at
  Microsoft.EntityFrameworkCore.Internal.InternalDbSet1.get_EntityQueryable()
  at
  Microsoft.EntityFrameworkCore.Internal.InternalDbSet1.System.Linq.IQueryable.get_Provider()
  at System.Linq.Queryable.Where[TSource](IQueryable1 source,
  Expression1 predicate)</p>
  </blockquote>
  <p>Another clue is this doesn't happen in a debug mode.</p>
  <p>Is there some kind of connections limit in DbContextFactory ?</p>