OpenConnection throws System.InvalidOperationException with Azure SQL when connection is not available

Posts   
 
    
kievBug
User
Posts: 105
Joined: 09-Jan-2009
# Posted on: 05-Apr-2018 15:44:27   

Hey guys,

I'm using latest LLBLGen with Azure SQL, when all connections are taken and no connections are available it throw System.InvalidOperationException, I think it makes more sense to throw different exception so that we can build retry logic for it.

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.

Exception type System.InvalidOperationException

Failed method SD.LLBLGen.Pro.ORMSupportClasses.DataAccessAdapterCore+<OpenConnectionAsync>d__208.MoveNext

Problem Id System.InvalidOperationException at SD.LLBLGen.Pro.ORMSupportClasses.DataAccessAdapterCore+<OpenConnectionAsync>d__208.MoveNext

Assembly SD.LLBLGen.Pro.ORMSupportClasses, Version=5.3.0.0, Culture=neutral, PublicKeyToken=ca73b74ba4e3ff27

Thanks, Anton

Walaa avatar
Walaa
Support Team
Posts: 14950
Joined: 21-Aug-2005
# Posted on: 05-Apr-2018 18:19:11   

Please apply Transient Error Recovery Strategy

There is one shipped for SQL Azure and ready for usage (SqlAzureRecoveryStrategy)

kievBug
User
Posts: 105
Joined: 09-Jan-2009
# Posted on: 05-Apr-2018 18:46:50   

Ok will give it a try. Hope it correctly handle this exception, based on the code doesn't look like it does handle.

Otis avatar
Otis
LLBLGen Pro Team
Posts: 39614
Joined: 17-Aug-2003
# Posted on: 06-Apr-2018 10:17:56   

It should, a timeout is one of the transient errors it is designed to overcome simple_smile

Frans Bouma | Lead developer LLBLGen Pro