Page 1 of 1

Error- Pooled connections maximum limit reached.

PostPosted: Tue Feb 27, 2018 5:14 pm
by sunad
We are working on a project where we are integrating Jiwa with a CRM...
It was all working fine until an error popped up...
Jiwa database is Hosted on a URL and we are accessing the database using that URL.

Below is the error-

We are getting
{
"ResponseStatus": {
"ErrorCode": "InvalidOperationException",
"Message": "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.",
"StackTrace": "[Authenticate: 2/23/2018 3:56:26 AM]:\n[REQUEST: {UserName:jiwausername,Password:jiwapassword}]\nSystem.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.\r\n at System.Data.ProviderBase.DbConnectionFactory.TryGetConnection(DbConnection owningConnection, TaskCompletionSource`1 retry, DbConnectionOptions userOptions, DbConnectionInternal oldConnection, DbConnectionInternal& connection)\r\n at System.Data.ProviderBase.DbConnectionInternal.TryOpenConnectionInternal(DbConnection outerConnection, DbConnectionFactory connectionFactory, TaskCompletionSource`1 retry, DbConnectionOptions userOptions)\r\n at System.Data.ProviderBase.DbConnectionClosed.TryOpenConnection(DbConnection outerConnection, DbConnectionFactory connectionFactory, TaskCompletionSource`1 retry, DbConnectionOptions userOptions)\r\n at System.Data.SqlClient.SqlConnection.TryOpenInner(TaskCompletionSource`1 retry)\r\n at System.Data.SqlClient.SqlConnection.TryOpen(TaskCompletionSource`1 retry)\r\n at System.Data.SqlClient.SqlConnection.Open()\r\n at JiwaFinancials.Jiwa.JiwaODBC.database.GetNewConnection(String NewConnectionString)\r\n at JiwaFinancials.Jiwa.JiwaODBC.database.Logon(AuthenticationModes AuthenticationMode, String Name, String Password, Boolean& rtnMustChangePassword, DateTime& rtnPasswordLastChangedDateTime)\r\n at JiwaFinancials.Jiwa.JiwaApplication.Manager.Logon(String ServerName, String DatabaseName, AuthenticationModes AuthenticationMode, String JiwaUserName, String JiwaPassword)\r\n at JiwaFinancials.Jiwa.JiwaServiceModel.JiwaAuthProvider.TryAuthenticate(IServiceBase authService, String userName, String password) in c:\\ProgramData\\Jiwa Financials\\Jiwa 7\\7.1.0\\SYSTEM\\IAT-SQL\\IAT_Trust7_TEST\\Plugins\\Admin\\Compile\\REST API\\REST API.cs:line 1120\r\n at ServiceStack.Auth.CredentialsAuthProvider.Authenticate(IServiceBase authService, IAuthSession session, String userName, String password, String referrerUrl)\r\n at ServiceStack.Auth.CredentialsAuthProvider.Authenticate(IServiceBase authService, IAuthSession session, Authenticate request)\r\n at ServiceStack.Auth.AuthenticateService.Authenticate(Authenticate request, String provider, IAuthSession session, IAuthProvider oAuthConfig)\r\n at ServiceStack.Auth.AuthenticateService.Post(Authenticate request)\r\n at lambda_method(Closure , Object , Object )\r\n at ServiceStack.Host.ServiceRunner`1.Execute(IRequest req, Object instance, TRequest requestDto)",
"Errors": []
}
}


The version of Jiwa which can be seen from this errors 7.1.0

More Information-
We are using Rest API.
Jiwa System and database are hosted on a remote Server.
We get this error while authentication API call.

Re: Error- Pooled connections maximum limit reached.

PostPosted: Wed Feb 28, 2018 5:42 am
by SBarnes
Hi Sunad,

I will assume for our email correspondence yesterday evening that this is now resolved?

Re: Error- Pooled connections maximum limit reached.  Topic is solved

PostPosted: Wed Feb 28, 2018 8:44 am
by DannyC
For anyone reading to fix, the Jiwa 7 API service was stopped & restarted.
Then a logoff needs to be done in the code to stop it happening again.

Re: Error- Pooled connections maximum limit reached.

PostPosted: Wed Feb 28, 2018 10:52 am
by Mike.Sheen
Thanks DannyC and SBarnes for helping out with this.

The REST API was intended to log off an authenticated user automatically when a session expires - but I've had a look and it appears it does not even attempt to do this - we must have forgotten about that bit!

I've added DEV-6510 to address this.

Mike

Re: Error- Pooled connections maximum limit reached.

PostPosted: Mon Mar 05, 2018 2:08 pm
by sunad
Yes Stuart, It is resolved.

Great thanks to Stuart Danny And Mike for helping us with this.

Sorry for late reply.