-
Notifications
You must be signed in to change notification settings - Fork 142
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
all pooled connections were in use and max pool size was reached #2
Comments
Can you connect to your DB at all? The Joe Duffy has a good writeup about dispose vs finalization: http://joeduffyblog.com/2005/04/08/dg-update-dispose-finalization-and-resource-management/ |
That's not what is causing your error. Please read up on the Dispose
Pattern.
As for what might be causing it, please make sure you are closing your
connections appropriately. Also please verify that you can connect to the
database with SSMS and plain ADO.NET.
…On Feb 15, 2017 12:15 PM, "Alex Maris" ***@***.***> wrote:
Can you connect to your DB at all?
The ~UnitOfWork() is the finalizer, and it should be correct in calling
dispose(false).
Joe Duffy has a good writeup about dispose vs finalization:
http://joeduffyblog.com/2005/04/08/dg-update-dispose-
finalization-and-resource-management/
—
You are receiving this because you are subscribed to this thread.
Reply to this email directly, view it on GitHub
<#2 (comment)>,
or mute the thread
<https://github.com/notifications/unsubscribe-auth/ABjIv_B33Fel0izvaIx2ibrGV_-hUAFvks5rczKWgaJpZM4MB8-3>
.
|
Hi, I can connect to the database (read and write data). Closing my connection? Can you detail? I'm doing like this. using (var uow = new UnitOfWork()) |
You don't seem to be setting the connection string name in the constructor.
…On Feb 15, 2017 12:31 PM, "Pedro Adão" ***@***.***> wrote:
Hi,
I can connect to the database (read and write data).
Closing my connection? Can you detail? I'm doing like this.
using (var uow = new UnitOfWork())
{
var user = uow.LoginRepository.Get(email);
}
—
You are receiving this because you commented.
Reply to this email directly, view it on GitHub
<#2 (comment)>,
or mute the thread
<https://github.com/notifications/unsubscribe-auth/ABjIvyr3KnFGRo3glfQfg0Ndcly9lXVzks5rczZVgaJpZM4MB8-3>
.
|
I have change the constructor `public UnitOfWork()
}` |
Please refer to the sample code located at:
https://github.com/timschreiber/DapperUnitOfWork/tree/master/DapperUnitOfWork.Console.
It is known to be working. If you have altered how the DapperUnitOfWork
code works, then there's not a whole lot I can do to help.
Just to be sure: Have you verified the connection string you are using is
correct?
~Tim
…On Wed, Feb 15, 2017 at 12:55 PM, Pedro Adão ***@***.***> wrote:
I have change the constructor
public UnitOfWork()
{
var connectionString = string.Empty;
connectionString = ConfigurationManager.ConnectionStrings["MyConnection"].
ConnectionString;
}
—
You are receiving this because you commented.
Reply to this email directly, view it on GitHub
<#2 (comment)>,
or mute the thread
<https://github.com/notifications/unsubscribe-auth/ABjIv1DgdDgixFxpeci_AUuJRN4hlLZJks5rczwPgaJpZM4MB8-3>
.
--
Tim Schreiber <tim.schreiber@gmail.com>
|
Hi, The connection string is correct. I can read and write data on tables. |
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, TaskCompletionSource
1 retry, DbConnectionOptions userOptions, DbConnectionInternal oldConnection, DbConnectionInternal& connection) at System.Data.ProviderBase.DbConnectionInternal.TryOpenConnectionInternal(DbConnection outerConnection, DbConnectionFactory connectionFactory, TaskCompletionSource
1 retry, DbConnectionOptions userOptions)at System.Data.ProviderBase.DbConnectionClosed.TryOpenConnection(DbConnection outerConnection, DbConnectionFactory connectionFactory, TaskCompletionSource
1 retry, DbConnectionOptions userOptions) at System.Data.SqlClient.SqlConnection.TryOpenInner(TaskCompletionSource
1 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);
Any ideia?
Can it be because of this?
~UnitOfWork()
{
dispose(false);
}
why dispose(false)?
Thank you,
Pedro Adão
The text was updated successfully, but these errors were encountered: