Entity Framework - How to clear connection pool manually? SNIX_Excecute Error

十年热恋 提交于 2020-01-30 09:22:06

问题


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

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!