问题
I'm using entity framework for a xamarin project. When the app is minimised on iOS and then opened again it throws connection problems (See error below): SNIX_Execute (provider: SNI_PN7, error: 35 - SNI_ERROR_35)
The only way I've found to solve this is to set pooling to false in the connection string.
I want to clear the connection pool manually in the OnSleep() method in xamarin. Is there anyway to clear Entity Framework's connection pool?
回答1:
Update - Just found out how to do it. On the resume method in add:
SqlConnection.ClearAllPools();
来源:https://stackoverflow.com/questions/58800868/entity-framework-how-to-clear-connection-pool-manually-snix-excecute-error