Skip to content

all pooled connections were in use and max pool size was reached #2

Description

@pedroadaodev

2017-02-15 16:12:45,519 DEBUG Error occurred during execution of 'Worker #4021037f' process. Execution will be retried (attempt 1 of 2147483647) in 00:00:00 seconds.
System.InvalidOperationException: Timeout expired. The timeout period elapsed prior to obtaining a connection from the pool. This may have occurred because all pooled connections were in use and max pool size was reached.
at System.Data.ProviderBase.DbConnectionFactory.TryGetConnection(DbConnection owningConnection, TaskCompletionSource1 retry, DbConnectionOptions userOptions, DbConnectionInternal oldConnection, DbConnectionInternal& connection) at System.Data.ProviderBase.DbConnectionInternal.TryOpenConnectionInternal(DbConnection outerConnection, DbConnectionFactory connectionFactory, TaskCompletionSource1 retry, DbConnectionOptions userOptions)
at System.Data.ProviderBase.DbConnectionClosed.TryOpenConnection(DbConnection outerConnection, DbConnectionFactory connectionFactory, TaskCompletionSource1 retry, DbConnectionOptions userOptions) at System.Data.SqlClient.SqlConnection.TryOpenInner(TaskCompletionSource1 retry)
at System.Data.SqlClient.SqlConnection.TryOpen(TaskCompletionSource`1 retry)
at System.Data.SqlClient.SqlConnection.Open()

In my code

using (var uow = new UnitOfWork())
{
// GET USER FROM DATABASE
var user = uow.LoginRepository.Get(email);

           // CREATE NEW ENTITY
            var entity = new FriendsEmail();
            entity.xxx = 1;
            entity.yyy = 2;

            // SAVE EMAILS
            uow.FriendsEmailRepository.Add(entity);
            uow.Commit();
        }

Any ideia?

Can it be because of this?

~UnitOfWork()
{
dispose(false);
}

why dispose(false)?

Thank you,
Pedro Adão

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions